Author Topic: Transitioning from TI-Basic to Axe Basic  (Read 10059 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Transitioning from TI-Basic to Axe Basic
« Reply #15 on: April 30, 2010, 06:38:32 pm »
I still like Axe a lot. You get the speed of ASM (well, almost) with almost the ease of BASIC. I did not have much issues with closing parhentesises, but it is indeed more stricts. I guess this is just some stuff to get used to. I myself started getting used to some of it, but again, I haven't coded BASIC much in the past year, so this might be why.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Transitioning from TI-Basic to Axe Basic
« Reply #16 on: April 30, 2010, 08:19:14 pm »
Its actually far more lax than BASIC.  Its just the change of some of the operators that might be confusing you.  The store arrow in BASIC used to mean store everything that came before it to a variable.  Now, it means store the current expression stack into a variable so you now have the freedom to use it inline.  And Axe doesn't really care much about using the enter button.  These are the same:

:A->C
:E->D

:A->CE->D

And things like this:

:A+1->A
:If A=10
:End

can reduce to this:

:If A+1->A=10
:End

And another thing most people don't know about.  The answer always carries over to the first argument of the commands.

:X
:Pxl-On(,Y)

Is actually the same as Pxl-On(X,Y) since the last expression was X and carried over.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Transitioning from TI-Basic to Axe Basic
« Reply #17 on: April 30, 2010, 08:44:56 pm »
Interesting... Parentheses et al. can still cause errors if mismatched, though, (e.g. For(X,L3,L3+10:{X-1->X:End, w/new lines instead of just colons, causes an ERROR:BLOCK for me) Maybe you could document what is and isn't valid?
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

_player1537

  • Guest
Re: Transitioning from TI-Basic to Axe Basic
« Reply #18 on: April 30, 2010, 08:47:01 pm »
"For(X,L3,L3+10):{X-1}->X:End" try that

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Transitioning from TI-Basic to Axe Basic
« Reply #19 on: April 30, 2010, 08:50:53 pm »
I was saying that more parentheses were more necessary than in BASIC.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Transitioning from TI-Basic to Axe Basic
« Reply #20 on: April 30, 2010, 08:53:13 pm »
I wonder if in future versions of Axe he could automatically add them when compiling, for stuff like For(, for example.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Transitioning from TI-Basic to Axe Basic
« Reply #21 on: April 30, 2010, 09:20:09 pm »
Interesting... Parentheses et al. can still cause errors if mismatched, though, (e.g. For(X,L3,L3+10:{X-1->X:End, w/new lines instead of just colons, causes an ERROR:BLOCK for me) Maybe you could document what is and isn't valid?
Really?  That should be proper syntax.  What you're telling the parser to do is to store the value X-1 into X and then read the data at that new location and do nothing with it.  If instead, you want the data at the location X-1 to store into X, then you need the closed parenthesis for this case.

If you're ever getting an error from not closing the parenthesis, let me know, becasue that should never happen, axe always adds the parenthesis at the end for you automatically like basic.  So when you type:

:{X-1->X

The parser should automatically put parenthesis at the end to make:

:{X-1->X}

And NOT this:

:{X-1}->X

As you use Axe more often, you find it is very convenient to use the arrow operator inline than it is to use it by itself.  It also optimizes the code size and speed significantly when used properly.  I can't make everything you typed so far just end every time you store, otherwise, you can't do these very efficient optimizations and coding tricks like for example: Fill(X->{L1},99) to fill ram at L1 with 100 copies of X.
« Last Edit: April 30, 2010, 09:23:29 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Transitioning from TI-Basic to Axe Basic
« Reply #22 on: May 01, 2010, 09:40:56 am »
Ah, I see. That's very interesting, and definitely very useful. However, why do I get an ERROR:BLOCK? Could someone verify that this happens for them too? I'm sure that's similar to one short program I had, which received that error. I'll check again...
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Transitioning from TI-Basic to Axe Basic
« Reply #23 on: May 01, 2010, 11:22:42 am »
The code above in Calcdude84se gives me ERR:BLOCK too. If I change {X+1->X}, it works fine, though. I wonder if this is some bug during parsing?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Transitioning from TI-Basic to Axe Basic
« Reply #24 on: May 01, 2010, 12:14:29 pm »
Yeah, it must be a bug then, I'll look into it.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Transitioning from TI-Basic to Axe Basic
« Reply #25 on: May 01, 2010, 12:17:13 pm »
Do not use pesticides, though. They're bad for environment.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)