I found an unexpected behavior with this code:
AFile FILE,DRIVER('TOPSPEED'),PRE(AFI),THREAD Record RECORD KeyField BYTE NameField STRING(20) END END ... TestWithoutPRE ROUTINE DATA AQueue QUEUE(AFI:Record) END CODE AFI:NameField = 'ABC' AssertEqual('ABC',AFile.AFI:NameField,'Without pre: file field') AssertEqual('',AQueue.NameField,'Without pre: queue field')
Both assertions fail. Looks like the string is assigned to the queue field instead of the file field.
Adding an empty
PRE to the queue, fixes the problem.
AQueue QUEUE(AFI:Record),PRE END
I think the compiler is failing to report a Label duplicated, second used warning when compiling, and silently using the second declaration.
I’m attaching a zip file with a test app. I’ll appreciate your comments before reporting it in PTSS.
queuefile.zip (13.6 KB)