No announcement yet.

Troubles with INC files and #USE, #IF USING statement

  • Filter
  • Time
  • Show
Clear All
new posts

  • Troubles with INC files and #USE, #IF USING statement

    I'm quite new with 4D labs hardware (less than one year) but I was able to perform a lot things since then.
    I'm working mostly in VISI. I was able to play with serial port, I2C port, analog input and Graph, and did a test project with form switching.

    I'm now trying to export some of my test codes in different INC files to clarify the core of the main program, and I have some issues with the "Selective" compilation.
    I was able to create an INC file with some sub routines Inside. When compiling without the usage of "#USE" statement ( in the core of the main program) and without "#IF USING - #ENDIF" statement around the body of my function, the compilation works.
    Then if I "activate" those statements, Compiler return an error. Please note that "RD_eep" is the name of the function I'm trying to call and that is Inside the INC file.

    Error: 'RD_eep' not found (line 629 file:CLOCK-fpo.4dg)
    Error: context error for unknown 'RD_eep' (line 629 file:CLOCK-fpo.4dg)

    SO maybe i'm doing Something wrong.
    Can you help?

    Note: sorry for my English, I'm French.

    best regards

  • #2
    I guess I have found what is wrong….if it is considered as wrong.
    Inside the main program, the "#USE" statement for the function I wish to use should be place BEFORE the "#inherit" of the INC file that contains this function.
    This sounds logical now, but it is not really explained in the documentation. Also, as somewhere else in the documentation it is written that function order has no real importance, I did not pay attention to this, thinking that compiler can deal with this.
    For this point order has a BIG significance.

    Best regards


    • #3
      Most, if not all, Pre-processors are 'single pass', so that implies that anything meant to influence them must be 'top down'