Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
const as string?
#5
programandala.net Wrote:Anyway this does what I need:

#define prompt chr(18,1,62,18,0,8)

A compile time macro is not the same thing than a language constant, but it works.

(By the way, I miss a help forum to post doubts. "Wish list", "bug reports" and "how-tos" are not suitable for that.)
This is a very good idea in fact, since chr(18,1,62,18,0,8) will be evaluated in *compile time* (not during run-time) and converted to a string. The compiler does string-folding optimization, so multiple occurrences of the same string in the program will map to the same memory region. This is the best way to do a const string :!:. I can add CONST a$ = ... syntax sugar if you want, but it will be translated into a macro like this.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)