You are fortunate enough to know what literal is. en.wikipedia.org is… search elsewhere.
For a home developer IDE, a better definition is awaited (wasn’t it the API2 goal to do things easier ?) in the LR.
As far as I understand, Const can hold a value that exists before compiling, not at running time.
So, no variable protection against low memory troubles. *
The method loads from a source (so fixed at Method run time / unknow value at compile time) folder that holds magazine cover scans.
Unfortunately, Const does not works there.
So, this remove many of the uses.
At last, I removed all Const and declare them as Dim (Xojo 2015r1).
Because I do use them only to put data in a TextArea, I was thinking naively that a Const was the way to go.
The whole was to build an html text file from magazine cover scans (where the Magazne Name, Price, Release date, Main Story, Total Pages… are in the name).
It tooks me less time to write the code to build the html than to realize was in a dead end and changed Const to Dim.
I also add to the project a method to resize the covers to 250 pixels and now I have75 % of a description html text document who needs only to complete the ToC to be finished.
- One day, I copied the names of a bunch of files and pasted it nto a TextArea (application running in the IDE).
I was surprised to get strings that are NOT in any of the files names After a simple checking, I was in low (very low) memory conditions (My Recent Items Sub-Menu disappeared from the Apple Menu, go figure).
Consider the two lines below:
Const Tab As String = Chr(9) // Does not Compile
Const Tab As String = &u09 // Compiles OK
From my point of view, in both cases, Tab will hold ASCII 9 value.
But the Compiler does not think so.
And, in your code, you can use Chr(9) or &u09 without trouble at all ;-