>I have a prg to call a form that will refer the function that find at the end of the prg, the program work fine if form is modal otherwise there is error saying that fun1 or fun1 is not found
>
>How can I fix this problem ?
>I have two prg have the same function name fun1, and fun2, how can I have both form/prg run without refer to wrong function ?
>
>can I define class by coding before calling the form and createobject inside the form ?
>I want to minimize the coding inside form and put them into prg !!!
>
>i.e.
>
>abc.prg
>a = "test"
>do form test
>return .t.
>
>function fun1
>a = '11111'
>return .t.
>
>function fun2
>b = '22222'
>return .t.
>
>xyz.prg
>a = 'bbbb'
>do form test2
>return .t.
>
>function fun1
>a = 'aaaa'
>return .t.
>
>function fun2
>a = 'bbbb'
>return .t.
Set procedure to ...
Partially resolves your problem. If functions are not returning values to use then :
do myFunc1 in PrgName
would solve another issue.
Better yet you can have different custom classes per different fun definitions and call like :
myCustom1.Fun1()
myCustom2.Fun1()
All these classes could be in same prg and you 'set proc to myClassDefs.prg' or with VFP6 and up :
myCustom1 = newobject('myCustomClass1','myClassDefs.prg','',paramlist...)
Or functions are completely specific to called forms then create methods just within forms.
Or create form classes that call particular versions of functions with same name.
Etc.
Cetin