This is the hardest concept in axe. Okay, so in basic, you do "Hello"->Str1. That stores the string "Hello" to the variable Str1. As a basic programmer, that's all that you have to worry about. However, behind the scenes, this what happens:
- Calculator looks up variable Str1
- Calculator finds variable in memory
- Calculator returns the variable data. (In this case, "hello")
In axe, it's different. the strings are stored inside the program, and the calculator doesn't have to look them up. Say I do this: "Hello"->Str1. It's the same command as before, but in this case, when the program is compiled, the compiler sees that line and does this:
- Writes the word "hello" into the compiled program, followed by a zero. (The zero is to tell any commands that access it, that there is no more text.)
- Finds the location of the "h" in "hello".
- Puts that value into Str1, so that whenever it is accessed again, it returns that value instead of the String itself
Also, because the strings are zero terminated, and Str1 points to the "H" character in memory, you can do stuff like Str1+3, which points to the second "L" in memory.
So try this program:
"HELLOL"->Str1
ClrHome
Disp Str1+3
pause 5000
That routine displays LOL, and then pauses for about 5 seconds.
Now, for the L1-L6 variables. They are all pointing to locations in memory where you can store things as well. Try the same program, but replace Str1 with L1. It doesn't work, does it? Well, that's because you can't really store into L1 like that. When using L1, since it's already predefined to certain locations, You can only access it by using {L1+n}, where n is the the byte you want to access, starting with 0. For example, the first byte of L1 is {L1}. It takes a while to get use to, but once you do, it's a very powerful feature. Just remember, Basic is not Axe, and Axe is not basic.