I have been working on a couple various programs, games, utilities, graphics etc, but i have forgoten hove you instruct another program to open another file!
My goal is to make one file, that you can boot everything from.
So, if i want to run my Tetris from it, i simple type Tetris in a INPUT, and then Tetris boots. When i shut Tetris down, i come back to the file that i could boot everything from.
The problem is, i have forgotten wich command it was that opened other files. If someone could answer me on this one, i would be grateful.
/Anlino
Minor problem...
- {Nathan}
- Veteran
- Posts: 1169
- Joined: Thu Aug 19, 2004 6:08 pm
- Location: The wetlands of central Ohio, USA
- Contact:
Im pretty sure you want chain. It is just like this:
or, if its a .exe then you want shell
it depends whether its a .exe or .bas.
Code: Select all
if lcase$(input$) = "tetris" then chain "tetris.bas"
Code: Select all
if lcase$(input$) = "tetris" then shell "tetris.exe"
Discovered a minor problem here Though...
When i type in the name of the program, it said that i couldnt find it, redo, or something like that. But when i doesnt type in anything, all programs boot.(It took a while to shut down all of them...) Here is a piece of the code i use:
IF (valj = Tetris) THEN
Shell "tetris.exe"
END IF
IF (valj = Pacman) THEN
Shell "pacman.exe"
END IF
IF (valj = Solitaire) THEN
shell "solitaire.exe"
END IF
Can anyone of you discover a mistyping or something like that in this piece of code?
(I know that i am being a real a:!::!: going around like this, but it puts you on when something doesnt work)
Thanks,
Anlino
When i type in the name of the program, it said that i couldnt find it, redo, or something like that. But when i doesnt type in anything, all programs boot.(It took a while to shut down all of them...) Here is a piece of the code i use:
IF (valj = Tetris) THEN
Shell "tetris.exe"
END IF
IF (valj = Pacman) THEN
Shell "pacman.exe"
END IF
IF (valj = Solitaire) THEN
shell "solitaire.exe"
END IF
Can anyone of you discover a mistyping or something like that in this piece of code?
(I know that i am being a real a:!::!: going around like this, but it puts you on when something doesnt work)
Thanks,
Anlino
You're using a numerical value, when you should be using a string. When you don't type in anything, that's basically like inputting 0, and previously unused variables are initialised as 0, so Tetris, Pacman, and Solitaire are all integers that are 0.
Also, you'll need to strip the input down so that the user can input them in either upper or lower or mixed case, that's what LCASE$() does. (It makes the string all lowercase.)
And you need to change all instances of valj to valj$ so that it's a string, not a numerical value.
Fixed code:
Also, you'll need to strip the input down so that the user can input them in either upper or lower or mixed case, that's what LCASE$() does. (It makes the string all lowercase.)
And you need to change all instances of valj to valj$ so that it's a string, not a numerical value.
Fixed code:
Code: Select all
IF (lcase$(valj$)) = "tetris") THEN
Shell "tetris.exe"
END IF
IF (lcase$(valj$)) = "pacman") THEN
Shell "pacman.exe"
END IF
IF (lcase$(valj$)) = "solitaire") THEN
shell "solitaire.exe"
END IF
If you need music composed in MP3, WAV, or MIDI format, please contact me via email.
Xerol's Music - Updated Regularly!
Xerol's Music - Updated Regularly!