Page 1 of 1

Hex Compiling

Posted: Wed May 15, 2019 10:19 pm
by Derek_Stewart
Hi,

What is the way to compile Hexadecimal numbers with Qliberator and SMSQ/E.

SMSQ/E can display hexadecimal numbers prefixed with a $ symbol.

Unfortunatley, Qliberator gives an error when trying to compile the statement.

Strangely enough, Turbo compiles this with no errors and works as expected.

Re: Hex Compiling

Posted: Thu May 16, 2019 6:59 am
by tofro
Derek,

There's an utility somewhere on Per's site (just recently re-opened), I believe, that replaces all hexadecimal constants in S*Basic programs with decimals for compilation. Should come in handy here.

(Thus, this is a just-in.time question)

Tobias

Re: Hex Compiling

Posted: Thu May 16, 2019 7:19 am
by JonS
Why not use HEX command?

Re: Hex Compiling

Posted: Thu May 16, 2019 7:28 am
by tofro
JonS wrote:Why not use HEX command?
You can use that. But if you have a lot of these hex constants in a program, this might
  1. be quite some work
  2. be slow (runtime-wise): QLiberator is not smart enough to see that HEX("<constant>") is still a constant and uses valuable time to do the conversion at run-time. Replacing the hex constant with a "real", numerical constant is much faster
Tobias

Re: Hex Compiling

Posted: Fri May 17, 2019 9:59 pm
by EmmBee
tofro wrote: There's an utility somewhere on Per's site (just recently re-opened), I believe, that replaces all hexadecimal constants in S*Basic programs with decimals for compilation. Should come in handy here.
Yes, I've found it here ... http://www.knoware.no/
It can be found under ENTER / GO SUB / DeHex
It looks like a very neat procedure.

Regarding Turbo, I note that it's not possible to compile a $0 or %0.
Those cases would have to use a plain 0.

Michael