Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coding in prg instead of inside forms ?
Message
From
21/08/2000 07:46:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
21/08/2000 07:19:43
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00407229
Message ID:
00407236
Views:
30
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform