I recently decided t learn Axe because it looks really cool, fast, and not that difficult...but I'll still be asking questions Razz

First of all, how does this even work?

Code:
44→Z*256→X

I got this from the PDF that came with the Axe download.
Just like C and other languages, the assignment operator returns the assigned value*. So 44 is assigned to Z, then 44*256 is assigned to X.

*Usually. Notable exception: assignment to a variable pointer.

You'll probably also end up seeing stuff like:

Code:
44→Z
*256→X

Axe carries values from one line to the next, so this is valid and identical to the code you posted.
In TI-Basic we would write it like this:


Code:
44->Z
Ans*256->X


For example, instead of this:

Code:
0->A
0->B
0->C

I would do this:

Code:
0->A->B->C
Can you multiply a string? I multiplied "HELLO WORLD" by two, and it gave me a bunch of weird characters....Shock
You can, but it doesn't do what you think it does. If you're familiar with pointers, strings are just handled as pointers in Axe. So you're multiplying the pointer value by two, which will almost certainly point to some garbage non-string data in memory.

As a side note, the fact that strings are handled as pointers is useful in the case of addition. Adding X to a string pointer gives the substring starting at character X (0-indexed).
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement