Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
REQ: Stored command execution
#21
Code:
case "IF A<B THEN A = C+B * (CalculateFirstPrime(B^2))":
...
...

Y'know... Wink
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#22
Hmmm...
Well you could have your program output the code you want to be executed to a text file, SHELL "FB " + filewhatever$ and then chain to the program that is output by FB then chain back to the original program. You'd still need to figure out how to get the program to return to the point right after where you had chained away once you returned.
Messy but I bet that might just work.
his sig left intentionally blank
Reply
#23
Code:
const program1$="jumper1"
const program2$="jumper2"

PRINT "Program 1"

IF jump = 1 THEN GOTO returnfromchain

OPEN program2$+".bas" FOR OUTPUT AS #1
PRINT #1, "Print " + CHR$(34) + "Program 2" + CHR$(34)
PRINT #1, "jump = 1"
PRINT #1, "chain " + CHR$(34) + program1$+".exe" + CHR$(34)
CLOSE #1

SHELL "FBC "+program2$+".bas"
CHAIN program2$+".exe"

returnfromchain:

print "done"
do
loop

That should do the trick, I think, haven't tested it.
Cool hack if it works though
his sig left intentionally blank
Reply
#24
It actually works! BTW, you don't need the chain argument in program two. When program 2 finishes, control is automatically returned to program 1 (at least when I try it). How about adding a function that does this automatically, and includes a copy of the fb compiler in your exe if the function is used?
8% of the teenage population smokes or has smoked pot. If you're one of the 2% who hasn't, copy and paste this in your signature.
Reply
#25
Quote:How about adding a function that does this automatically, and includes a copy of the fb compiler in your exe if the function is used?
How about no? Adding 250KiB to the executable for just one function is completely pointless and utterly silly. Dinosaur had the most useful idea here. Not to mention it is far smaller at that. :wink:
Reply
#26
Yeah, it's something that less than 0.00000001% of people will use.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)