Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: benedikt.muessig on May 29, 2014, 12:23:14 pm

Title: Variable Help
Post by: benedikt.muessig on May 29, 2014, 12:23:14 pm

Hello,Theres no proper documentation for axe, no good tutorial.  :banghead:
I need help!!!!


I'm making a game and want to name vars.
I heard about naming vars with 5 letters.
How can I do this,
e.g. KNN0X and KNN0Y
I have multiple sprites and want have the format nameofspriteX and ~Y.
I have just no idea how to deal with variables i need more than A-Z and a need no constants.
Title: Re: Variable Help
Post by: Streetwalrus on May 29, 2014, 12:29:03 pm
If you want your variable to use the first two bytes of L1, do L1->°NAME, where NAME is the name of your variable (duh), which can be up to 13 characters. Then just use NAME as a normal variable.

It's true that there is no good tutorial, but the Commands.html file is very complete as a documentation and I learned most of Axe with it.
Title: Re: Variable Help
Post by: Sorunome on May 29, 2014, 12:30:57 pm
Oh, THAT is how you do that, always wondered how xD
Title: Re: Variable Help
Post by: Streetwalrus on May 29, 2014, 12:34:19 pm
Yep it is. :P
Title: Re: Variable Help
Post by: Hayleia on May 29, 2014, 01:53:21 pm
And you can use up to 13 characters in variable names, not just 5 ;)
Title: Re: Variable Help
Post by: Streetwalrus on May 29, 2014, 01:58:39 pm
And you can use up to 13 characters in variable names, not just 5 ;)
You're late to the party, I already helped him on IRC. :P Turns out he needed an array.
Also read my post closer.
Title: Re: Variable Help
Post by: Eiyeron on May 30, 2014, 07:01:25 am
And how can one use the variable as a variable and not a pointer to something? (use its adress or something like this to avoid using using Lx areas)
Title: Re: Variable Help
Post by: Hayleia on May 30, 2014, 07:08:20 am
And you can use up to 13 characters in variable names, not just 5 ;)
You're late to the party, I already helped him on IRC. :P Turns out he needed an array.
Also read my post closer.
Sorry, was tired -.-

And how can one use the variable as a variable and not a pointer to something? (use its adress or something like this to avoid using using Lx areas)
That doesn't mean anything. The variable is not a pointer. Its value is pointed by a pointer (no joke!) but once you did "L5+04→°Wattouat", Wattouat is the value, not the pointer which is °Wattouat.
Moreover, A, B, etc also have pointers, which are °A, °B, etc so if you think you are using pointers with Wattouat, you are doing it too with A, B, etc.
Last of all, nothing prevents you from not using Lx ram areas by using other free ram areas (http://www.omnimaga.org/asm-language/8384-free-ram-areas/msg306283/#msg306283).
Title: Re: Variable Help
Post by: Eiyeron on May 30, 2014, 07:09:37 am
Okay, so I need to allocate to the custom variable an area. Thanks.
Title: Re: Variable Help
Post by: Hayleia on May 30, 2014, 07:12:10 am
Yeah, you just say "this variable will use those two bytes" and you give a pointer to two bytes. Whatever that pointer is. You can even do °A→°ThisIsA if you like useless things are using A for two different purposes in two different parts of your code and want it to have two names.