Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: TiAddict on July 28, 2011, 08:46:32 pm
-
Can someone show me the routines for them? i tried the ones in the routine section, but it's not working.
-
Do you mean how to use them in Axe code or how they are coded in Asm? I'm sorry, I'm a noob when it comes to programming words and phrases :P
-
Do you mean how to use them in Axe code or how they are coded in Asm? I'm sorry, I'm a noob when it comes to programming words and phrases :P
He's asking for an example method in Axe.
-
Well since we cant use instring( command, how should i do it?
-
He's asking for an example method in Axe.
Thanks! I don't know how to use Instring(, but for sub(, you use it to create subroutines.
Axe
.After you store constants, you create subroutines, like:
sub(AA)
Repeat getKey(15)
.Code code code
sub(AA)
.This executes the subroutine
.code code
End
Return
.The Return ends the program so that the subroutines aren't executed after the Repeat loop ends
Lbl AA
.Code for subroutine
Return
.The label tells the parser where the code for sub(AA) starts, and the Return where it ends
I hope this helps, I know it's a little rough. I can post something that actually does something, not just a general example if needed. Good luck, and may the ram clears be few! ;D
EDIT:
I looked around, and for inString(, the synax appears to be inString(BYTE, POINTER) and it "Searches for the byte in the zero-terminated data. If found, it returns the position it was found in (starting at 1). If not found, 0 is returned."
This is strait off of the documentation for every Axe command in the zip with the parser
-
haha:) thank you for the command "sub(" in axe, but im asking in Basic to Axe
-
Do you mean what does sub( do in Basic?
-
Oh, searching for data and getting substrings in axe. Well, in axe, you can do InData( with.. InData( :P getting a sub string is simple too; just do something like Copy(String+Offset, New_String_malloc, length)
-
Wow... I was off of the question :o
Sorry, I read the question differently.
-
I still appreciate trying to help xD
What is "New_String_malloc" Ashbad
-
The location where you would be copying the substring to in memory terms. Just put a pointer to some free chunk of memory there and you'll be set.
-
This may help you with inData (inString): http://ourl.ca/4129/114828
-
Here are some implementations I whipped up to act just like the TI-BASIC string functions. The instring function even has the optional third argument! ;D However, note that the substring function should probably not be used to create substrings over 255 characters long, and definitely not 0 characters long. Also, the optional third argument for the instring function should not be longer the length of the string being searched. But other than that, they should work perfectly!
You can get a bit more information about the functions and download the ready-to-go Axe library here (http://ourl.ca/4129/231479).
Lbl SUB
Copy(r?+r?-1,?8000,r?)
and 0?{r?+?8000}
Return ?8000
Lbl INS
If -r?
r?-1
End
+r?
Lbl INL
Return!If {?r?}
If Equ?String(r?,r?)
If {}
r?+1
Goto INL
End
End
Return r?-r?+1
-
Can someone show me the routines for them? i tried the ones in the routine section, but it's not working.
Taking a stab at it: You might be confused because Axe's inData( takes its arguments in the order exactly opposite that of BASIC's inString(. Byte to search for comes first, then the pointer to the data string.