prefixbasicsuffixpowerbasic

Explanation of trailing character %


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.


Solution

  • 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.