FB II Compiler
FB II COMPILER
I puzzled over this for quite a while, because I have been initializing my globals in the .MAIN file (as specified on P.98 of the FB reference manual) all along - with no apparent problems. I eventually realized that the piece that I was missing was that my cross referenced functions never had the same names that the original functions had, thus avoiding the problem David was describing. This is because I use a rather structured Naming convention, some of which I think I got from one of Frank Turovich's books (although I am unable to find the reference).
I thought I'd present it for your amusement :
1. .INCL file Names are constructed as follows :
a. The project name followed by a space, and
b. A unique lower case letter followed by the "_" character, and
c. A 4 to 7 character string describing the file's function, and
d. The string ".INCL"
-> examples are "Stepper u_Menu.INCL" and "Stepper w_Window.INCL"
2. .INCL file Functions that are called externally to the file are
named by prefacing them with the unique lower case letter followed
by the "_" character in the .INCL file's name.
-> An example is "FN u_Ck_Data_Menu" from "Stepper u_Menu.INCL"
3. Names of Pointers to externally called .INCL file functions are constructed as follows :
a. The string "g_", and
b. The function name (with the "_" stripped out), and
c. The string "Ptr&".
-> An example is "g_uCk_Data_MenuPtr&" to "FN u_Ck_Data_Menu"
4. Names of Cross referenced Functions in include files are constructed as follows :
a. The string "x", and
b. The function name with the lower case letter and the "_" stripped out.
-> An example is "FN xCk_Data_Menu" for "FN u_Ck_Data_Menu"
This Convention :
Identifies and groups together all the cross referenced functions in
the Project window
Identifies and groups together all external called functions in the
Ensures that the function pointers are unique in their first 10
or so characters
Makes multi include file projects easier to keep track of
Works for me