fbpx
Welcome, Guest
Username: Password: Remember me
This public forum is meant for questions and discussions about Visual FoxPro
  • Page:
  • 1

TOPIC: I need to understand the name resolution in XSharp.

I need to understand the name resolution in XSharp. 19 Jun 2020 20:36 #15034

  • jpmoschi's Avatar

  • jpmoschi

  • Topic Author


  • Posts: 9
  • 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

    Please Log in or Create an account to join the conversation.

    I need to understand the name resolution in XSharp. 19 Jun 2020 21:33 #15035

  • Chris's Avatar

  • Chris


  • Posts: 1957
  • The fundamental difference in X# is that it is not using an interpreter, instead the code is getting compiled as a whole into exes and dlls, and any procedure/function call needs to be available when compiling. What you did with calling the procedure from another file, should work of course, but maybe there's some difference with the parameters you passed when calling it (since X# supports overloading of procs/metods etc). Can you please show us exactly how the procedure is declared and how you are calling it?

    Btw, having said the above, after some time I think it will be probably possible to emulate some of the CFP way of calling procedures, but that's something for the future.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1