Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alias myprogram Not Found
Message
From
24/05/2001 05:07:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/05/2001 19:12:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00510655
Message ID:
00510745
Views:
12
>Hi All:
>
>Why is VFP looking for an Alias when I am not calling a table.
>
>i.e. .MsgNoteText = GETFILE(recordtostring.prg)
>
>I am trying to call a .prg file which has a function() that I need because, VFP does not allow "nested function within a method or an event". Please correct me if I am wrong and provide guidance.
>
>PS- I tried GETFILE, SET FUNCTION TO
>
>Thank you ALL AGIAN IN ADVANCE.
>PM

Paul,
Since I know the background of this question well I'll directly talk about how you would do it :)
In fact what you want to do is to run recordtostring.prg.
Your call would be :

.MsgNoteText = recordtostring()

VFP does not allow "nested function within a method or an event". Yes true, but a .PRG as a procedure file could have many functions, class definitions in it. It's different from a method, event code.
*a commandbutton click
.MsgNoteText = recordtostring()

function RecordToString
...
Is not legal and causes the error you mentioned. OTOH this is legal :
*RecordToString.prg as a separate external file
*code ...  && Remember first line doesn't have a 'Function ...' here
* Otherwise a call would return immediately with .T.
* Because an implicit 'return .T.' is applied as a line
* starting with 'Function' or 'Procedure' encountered
myText = TypeConvert(myValue)
return myText

function TypeConvert && A prg could have multiple functions and/or classes in it
lparameters luValue
*code...
return SomeString

* Other function and procedures if any..

*Classes after procs and funcs if any..

*a commandbutton click
.MsgNoteText = recordtostring() && Here calls external recordtostring.prg
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
Reply
Map
View

Click here to load this message in the networking platform