I have many many files in my project. The other day, I was very very happy to get them all ported to PB so that it would at least compile (may not work but that is for another day). Now that I have the basis done, I started porting another file. This time, it uses structures that are declared in other files. Here are some details:
Code: Select all
Structure AccountsRec
AccessCode.l ;As Long ; Integer
FirstName.s{30} ;As String * 30 ; String
LastName.s{30} ;As String * 30 ; String
Address.s{50} ;As String * 50 ; String
City.s{50} ;As String * 50 ; String
State.s{2} ;As String * 2 ; String
AccessUnits.s{250} ;As String * 250
EndStructure
Global Dim Accounts.AccountsRec(1)
Here is the code trying to access the structure:
Code: Select all
Procedure.w RemoteEvent(Address.l, Slot.w, Remote_Response_Data.s, Module_Type.s, Module_Device_No.l = 0, Remote_Date.s=#NULL$, Remote_Time.s = #NULL$,DrOpen.a=#False, DispAlarm.a = #False, MstcMuxAddress.l=0, Count.w=0, ExtraData.s = #NULL$);.w ; As Integer
Protected Stat.w ; As Integer
;Clear these out so it displays properly if there is an invalid code...
Accounts(1)\FirstName = ""
Accounts(1)\LastName = ""
However, if I put this same line into the Main file, which is the default target, it compiles just fine (I do have to remove the offending file from the project in it).
All files are part of an include list that is accessed before this file is (in code, not sure in compile).
This is the Main file starting code:
Code: Select all
EnableExplicit
IncludeFile "IncludeFiles.pbi"
Code: Select all
IncludeFile "Globals.pbi"
IncludeFile "Initialize.pb"
IncludeFile "Poll.pbi"
IncludeFile "Decode Global.pb"
IncludeFile "Decode Voltage.pb"
IncludeFile "Decode Wireless.pb"
IncludeFile "Make String.pb"
IncludeFile "Manage License.pbi"
IncludeFile "Act On Status.pb"
IncludeFile "Database\PSQL_Accounts.pbi"
The only thing I can think of, is PB wants these structures to be reviewed before anything else. But that does not seem realistic to me, nor does it make sense since the Main file is not accessing this data or structures either. Or. it wants the files with the Structures listed FIRST, then the others? I may not be explaining this well - because I don't really know what is going on.
Can anyone enlighten me?
Thank you
Tim