Howdy everyone. Are there any plans for PowerBASIC to support CHR$() within a
string constant? That is, being able to embed CHR$(13) or CHR$(27) without
having to explicitly use CHR$. *OR* have CHR$(numerical constant) evaluated
at compile time.
A source line such as:
a$ = chr$(27) + "[33m" + chr$(13)
disassembles to:
mov ax,001B ; CHR$(27)
call far [083C] ; CHR routine?
mov bx,0000 ; save a byte and do XOR BX,BX
call far [0454] ; concaneatate string routine?
call far [0374] ; " " "
mov ax,000D ; CHR$(13)
call far [083C] ; CHR routine?
etc.
But, this evaluation can be done at compile time. Benefits: faster, and
smaller.
MoonRock does it like this:
a$ = "\x1b[33m\x0d"
^^^^ ^^^^
CHR$(27) ||
CHR$(13)
Cheers.
---
---------------
* Origin: Jelly-Bean software development, Melbourne AUST. (3:635/727.1)
|