1

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.

Paul Lefebvre
  • 6,253
  • 3
  • 28
  • 36
Amiga500
  • 5,874
  • 10
  • 64
  • 117

2 Answers2

3

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.

2

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.