0
votes

I have an old program written in Pascal here, and after I have never learned Pascal, I do not understand everything. I have in my program several assignments like asdf = $03A2. What does the $ mean? Usually, there is no sign in front of the assigned numbers.

1
It means it's a hexadecimal number. Normally, Pascal assumes decimal, like most other languages. And like most other languages, some kind of prefix is required to indicate a different radix for the constant value (hex, binary, octal). - lurker
Note that $ is a feature of Borland derived dialects. IIRC the extended pascal standard did it differently, Standard Pascal didn't have the feature. - Marco van de Voort
@MarcovandeVoort yes that is correct. Extended Pascal would use, for example, 16#03A2 for a hexadecimal constants. Both of these formats are supported by GNU Pascal. - lurker
Unfortunately, GNU Pascal itself seems to be no longer supported :-) - Marco van de Voort

1 Answers

1
votes

The $ represents a hexadecimal number. If $ is not there, it means that is a number in base 10.