Explanation of trailing character %

1k Views Asked by At

In an ancient PowerBasic file, I found this in the code:

%AppendRec= 1% '^a    Write/Append Btrieve record to named file
%PrtBar= 2%    '^b    Print a Bar Code

My question deals with the numbers after the = sign. I assume the trailing % has a meaning, but I can't figure out what that meaning is.
I know that in QB, % denotes an Integer type but that normally leads the variable as shown at the beginning of the code lines. The trailing % has me confused.

2

There are 2 best solutions below

0
On BEST ANSWER

It is used to specify the type of the constant, so you don't have e.g. "1" evaluate to a float and then have to be converted to an int.

This page shows you the defaults that PB uses if you don't explicitly specify the type of constants.

0
On

Like Charles said it defines the type as int. Prefixing it with % like the variable on the left is defining a numeric equate/constant. The page link is old now though and their new help is at PowerBasicHelp

Look for Numeric Equates and Data Types.