Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: holmes221b on December 16, 2010, 11:55:53 am
-
I'm trying to create a program that will run a compiled program specified by the user.
Here's what I've tried (and none of them work, I keep getting ERR:Syntax):
:Input "PRGM?", Str1
:asm(prgmStr1
:Input PRGM?", Str1
:asm(Str1
Any way of making this work?
-
I haven't tried it yet, but maybre try this:
:Input "PRGM?",Str1
:"Asm(prgm"+Str1->Str1
:expr(Str1
make sure the "Asm" and the "prgm" are the tokens, and not characters
EDIT: nvm, doesn't work, if you have a finite number of choices in mind, then your best bet is If statements, otherwise, I think Axe may be able to do it.
-
How would I do it with If statements?
-
well, say you are going to Run 3 different Asm Programs, called ASM1, ASM2, and ASM3:
:Input "PRGM?",Str1
:If Str1="ASM1"
:Then
:Asm(prgmASM1
:End
:If Str1="ASM2"
:Then
:Asm(prgmASM2
:End
:If Str1="ASM3"
:Then
:Asm(prgmASM3
:End
note that this is for a finite number of programs only and if you know the names of the programs.
-
I couldn't speak towards Axe, but from a pure assembly perspective, the only way to do this is to use a loader program whose only purpose is to take the name of a program as a string, look it up, and run it, similar to what ZASMLOAD used to do way back in the day:
"MYPROG
Asm(prgmLOADER
(and prgmLOADER would look up Ans as a string, get the name out of it, look up the program, and load it)
-
Thanks, yunhua, that gives me something to work with.../me has had an thought about how to make it work the way I want it to work, while still using If statements.
BrandonW, I'm trying to come up with something that is purely TI-Basic (mostly because that's really the only programming language I know well enough to create original programs with).
-
If the assembly program isn't that large you can even have it all in the same program:
[code]:Input "PRGM?",Str1
:If Str1="ASM3"
:Then
:AsmPrgm
:HEX CODE
:End
[/code]
:D
-
If the assembly program isn't that large you can even have it all in the same program:
[code]:Input "PRGM?",Str1
:If Str1="ASM3"
:Then
:AsmPrgm
:HEX CODE
:End
[/code]
:D
You can't do that. Programs are either ASM or BASIC, not a combination. Running that program would give you a syntax error at the AsmPrgm, since it's not actually a command.
-
If the assembly program isn't that large you can even have it all in the same program:
[code]:Input "PRGM?",Str1
:If Str1="ASM3"
:Then
:AsmPrgm
:HEX CODE
:End
[/code]
:D
You can't do that. Programs are either ASM or BASIC, not a combination. Running that program would give you a syntax error at the AsmPrgm, since it's not actually a command.
Really? had no idea. Sorry, then :S
-
If the assembly program isn't that large you can even have it all in the same program:
[code]:Input "PRGM?",Str1
:If Str1="ASM3"
:Then
:AsmPrgm
:HEX CODE
:End
[/code]
:D
You can't do that. Programs are either ASM or BASIC, not a combination. Running that program would give you a syntax error at the AsmPrgm, since it's not actually a command.
Really? had no idea. Sorry, then :S
That's why Asm( is needed to run ASM programs (so the OS knows it's that). It's all right, though, just try to make sure you know what you're posting ;)
-
I swear I posted in here, or maybe it was a different topic. Asm(Hex would only work in Axe. In Doors CS it would be the ExecAsm( command (I forgot the real(number, equivalent).
-
I swear I posted in here, or maybe it was a different topic. Asm(Hex would only work in Axe. In Doors CS it would be the ExecAsm( command (I forgot the real(number, equivalent).
Err... Isn't ExecAsm( used with identity(? real( is for xLib, and xLib doesn't have ExecAsm( - Celtic III has...
Or do you mean the Omnicalc real(?
-
det(20,"Hex String") and real(33,"Hex String") both work. :)
-
I tend to confuse det( and identity(... D:
-
I swear I posted in here, or maybe it was a different topic. Asm(Hex would only work in Axe. In Doors CS it would be the ExecAsm( command (I forgot the real(number, equivalent).
Err... Isn't ExecAsm( used with identity(? real( is for xLib, and xLib doesn't have ExecAsm( - Celtic III has...
Or do you mean the Omnicalc real(?
Oh strange, I thought it used real, since DCS has backwards copmpatibility with omnicalc and xLIB (which both uses real and Omnicalc has an ExecAsm command)
Does this means a BASIC game using Omnicalc's ExecAsm command would not work in DCS? O.O
-
Does this means a BASIC game using Omnicalc's ExecAsm command would not work in DCS? O.O
It would work in DCS. I was just a bit confused, since real( is used by xLib, and xLib doesn't support ExecAsm( (but Omnicalc does).
-
I think both xLib and Omnicalc use real() functions, but Omnicalc's real functions don't interfere with xLib, so they can both be run at the same time
-
Nah, Omnicalc cannot be ran at the same time. I think Celtic III/Doors CS was made so Omnicalc's ExecAsm will run fine, though, through Celtic III/DCS.