I need to understand the name resolution in XSharp.
Posted: Fri Jun 19, 2020 6:36 pm
I need to understand the name resolution in XSharp.
My background is VFP where "names" are resolved in order of loading into memory.
For example:
do ProcOrFunc with par1, par2, ...
First of all, the name ProcOrFunc is searched in memory It may have been previously loaded into memory by the program flow that was loading all the procedures contained in each program file refered.
Suppous the next a program flow
do prg1
...
set procedure to prg3
do prg2
---
do ProcOrFunc ...
etc...
If ProcOrFunc name is not found in memory, that is, it exists as a procedure contained in some prgfile of the call stack, finally it looks for it as a file with the name ProcOrFunc.fxp or ProcOrFunc.prg. Just then, if you can't find it, it generates the error "File ProcOrFunc.prg that not exist".
What happens in XSharp?
I Created a WindowsFormsApplication with:
- Form1.prg
- CodeFile1.prg
I have the error XS0103 when trayng to call a public procedure or function created inside CodeFile1.prg
from a method or event inside the Form1 class that inherits from System.Windows.Forms.Form
best regard
Please, be patient with VFP structured brain
Robert, you can undestand this looking my foxpro Example
My background is VFP where "names" are resolved in order of loading into memory.
For example:
do ProcOrFunc with par1, par2, ...
First of all, the name ProcOrFunc is searched in memory It may have been previously loaded into memory by the program flow that was loading all the procedures contained in each program file refered.
Suppous the next a program flow
do prg1
...
set procedure to prg3
do prg2
---
do ProcOrFunc ...
etc...
If ProcOrFunc name is not found in memory, that is, it exists as a procedure contained in some prgfile of the call stack, finally it looks for it as a file with the name ProcOrFunc.fxp or ProcOrFunc.prg. Just then, if you can't find it, it generates the error "File ProcOrFunc.prg that not exist".
What happens in XSharp?
I Created a WindowsFormsApplication with:
- Form1.prg
- CodeFile1.prg
I have the error XS0103 when trayng to call a public procedure or function created inside CodeFile1.prg
from a method or event inside the Form1 class that inherits from System.Windows.Forms.Form
best regard
Please, be patient with VFP structured brain
Robert, you can undestand this looking my foxpro Example