finae
10 years agoContributor
hiding private sub/functions
Hi all,
Does anyone have an idea on how to hid sub/functions if its marked as private?
i m using TC9
script 1:
dim def
public hij
private sub ABC
log.message "test"
end sub
script 2:
'USEUNIT SCRIPT1
SCRIPT1.ABC <--- you can see in the code completion even though its marked as private in script1
SCRIPT1.DEF <------ cannot see this in code completion since its private,
SCRIPT.HIJ <----- can see this in code completion as its marked as public.
so far the only way i can think of would be to create a class pull items into the class with only 1 function to create the instance of teh class
then in a secodn script to call those specific public routine ,and leave the others alone.
script1:
class apple
private name_
private qty_
private sub class_initialize
name_=""
qty_=0
end sub
public property Get Name
Name=Name_
end property
public sub CreateApple(name,qty)
name_=name
qty_=qty
end sub
private disposeApple()
name_=""
qty_=0
end sub
end class
public function CreateAppleObj
set CreateAppleObj=New Apple
end function
as all the functions/routine is not visible (to code completion)
script 2:
'useunit script1
public apple
public function CreateApplObj
set apple=script1.CreateAppleObj
end function
public function Name
Name= apple.Name
end function
public function CreateApple(name,qty)
apple.createapple name,qty
end function
problem with this is now i have 2 script to maintain.
any suggestion?
thanks
Does anyone have an idea on how to hid sub/functions if its marked as private?
i m using TC9
script 1:
dim def
public hij
private sub ABC
log.message "test"
end sub
script 2:
'USEUNIT SCRIPT1
SCRIPT1.ABC <--- you can see in the code completion even though its marked as private in script1
SCRIPT1.DEF <------ cannot see this in code completion since its private,
SCRIPT.HIJ <----- can see this in code completion as its marked as public.
so far the only way i can think of would be to create a class pull items into the class with only 1 function to create the instance of teh class
then in a secodn script to call those specific public routine ,and leave the others alone.
script1:
class apple
private name_
private qty_
private sub class_initialize
name_=""
qty_=0
end sub
public property Get Name
Name=Name_
end property
public sub CreateApple(name,qty)
name_=name
qty_=qty
end sub
private disposeApple()
name_=""
qty_=0
end sub
end class
public function CreateAppleObj
set CreateAppleObj=New Apple
end function
as all the functions/routine is not visible (to code completion)
script 2:
'useunit script1
public apple
public function CreateApplObj
set apple=script1.CreateAppleObj
end function
public function Name
Name= apple.Name
end function
public function CreateApple(name,qty)
apple.createapple name,qty
end function
problem with this is now i have 2 script to maintain.
any suggestion?
thanks