07-23-2003, 06:56 PM
When I try to compare a string variable that is also a random-file record against a regular string variable, the IF statement is completely ignored, and just moves on to the ELSE statement.
For example:
Thanks for any help, once again.
For example:
Quote:TYPE samplerecord
var1 as string*15
END TYPE
DIM record as samplerecord
OPEN "test.dat" for RANDOM as #1 LEN=LEN(record)
'write a sample value to the string for an example
record.var1="Test"
'Write the variable to the file and then retrieve it
PUT #1, 1, record
GET #1, 1, record
IF record.var1="Test" THEN 'test the variable
PRINT "Ok."
ELSE
PRINT "Did not work."
ENDIF
'as you can see it won't work.
Thanks for any help, once again.