Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: Broseph Radson on September 22, 2010, 10:12:58 am

Title: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: Broseph Radson on September 22, 2010, 10:12:58 am
Whenever i compile an axe program with more than one line of code (besides the name), when i run it, TIOS returns an invalid dimension error. Im doing everything right, but if theres more than one line of code, it doesnt work. It compiles fine, but it gets an error. ???

I have no extra libraries installed, im compiling it for no shell and running in from the homescreen using Asm(

This is my first time actually using axe since i havent been able to get the commands page until just now (Printer failure).

Im also using version 0.4.1 since ti connect is garbage and wont connect to my calc anymore unless its on my Grandma's laptop.

All im trying to do ATM is make a simple program that displays a key code when pressed.

Im assuming that this code *should* work:
Code: [Select]
.KEY
Repeat Ans
getkey(0)
If Ans
Disp Ans>Dec
Disp i     //imaginary
End
End

Or something of that nature.

EDIT: Im not very experienced with the language as you can probably tell.
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: SirCmpwn on September 22, 2010, 10:17:11 am
Don't use Ans, it's not what you think.  Axe will never store to Ans if you don't use →Ans.
Here is my keypress program:
Code: [Select]
.KEY
Repeat getKey→K=/=15  // =/= is not equal to, and you just have to remember that Clear is 15
If K
ClrHome
Disp K>Dec
End
End
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: Broseph Radson on September 22, 2010, 10:21:41 am
Oh ok so Ans was causing that. Thanks :D

I should be going to my grandparents' house this thursday so ill get the current version on my calc.
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: LordConiupiter on September 22, 2010, 05:30:47 pm
or maybe you should just install TiLP :P
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: Happybobjr on September 22, 2010, 05:41:27 pm
Tilp????? what's that?!
it sounds great (aka. not ti-connect)
do you have to install drivers to the computer to use it?  If not, i could use it at school!.

plz give a link :D :D :D
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: LordConiupiter on September 22, 2010, 06:05:14 pm
TiLP Is a Linking Program :P
and here (http://lpg.ticalc.org/prj_tilp/index.html)'s your link.
and yes, you need drivers, and GTK+, because it's not only windows, but even for Linux and Mac
But since it's open source, you could write your own portable Windows version based on it :D
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: DJ Omnimaga on September 22, 2010, 11:36:58 pm
or maybe you should just install TiLP :P
Maybe his parents won't allow him to install stuff on his computer :P . Maybe they even blocked USB ports. Also wouldn't it be hard to write his own portable version if he has no computer programming knowledge?
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: Broseph Radson on September 23, 2010, 09:18:49 am
I'll try TiLP. TI-Connect is just a bad program IMO. Although the Mac version does have a program editor built in. For some reason they just left that feature out of the Windows version  :'(
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: DJ Omnimaga on September 23, 2010, 09:21:10 am
Yeah it's not very good. As for the prgm editor, TI-Connect 1.5 had one but it was removed in 1.6, along with TI-Group Editor and various old features I liked from 1.2 and 1.3.

The only reason why I use it instead of TiLP is because I do not feel like messing around the whole 64-bit issue with drivers.
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: Broseph Radson on September 23, 2010, 11:40:36 am
I have another question (again im not very experienced lol).

If i have a mouse cursor like this one:

Code: [Select]
0→A
0→B
Repeat getkey(54)
ClrDraw
Pt-On(A,B,Pic1
DispGraph
A+(getkey(3))-(getkey(2))→A
B+(getkey(1))-(getkey(4))→B
End

How would i test if the cursor is within a certain area? Ive tried compound conditionals like this:

Code: [Select]
10<A<15

And an If block with a long conditional:
Code: [Select]
If (A>10) and (A<15) and so on
And i dont like using nested control blocks unless its with loops.

This is for clicking buttons and whatnot by the way.
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: Deep Toaster on September 23, 2010, 02:19:37 pm
10<A<15 would work almost the same way as in BASIC, meaning it would be read as
Code: (Axe) [Select]
(10<A)<15
and since 10<A gives either a 1 (true) or 0 (false), it'll always come out true.

And for that long conditional, remember there is no order of operations, so just do
Code: (Axe) [Select]
:If A>10 and (A<15 and (A≠12 and ( ... )))
and it should work.

EDIT: Actually, nested control blocks would be a good idea, because the way Axe works, a long If statement would be translated the same way anyway, and it's a lot easier to debug if you have them nested.
Title: Re: Need help. Programs with more than one line always return a TIOS Invalid dim err
Post by: Broseph Radson on September 23, 2010, 07:01:07 pm
Alright thanks :)

Im also finally able to get the latest Axe update so that should help a bit.