Need advice on getting out of prog to a .com file
Author |
Message |
Gloria L. McMilla #1 / 25
|
 Need advice on getting out of prog to a .com file
Hi, all! I am still pluggin away on that umbrella program for my Linguistics prof. We have these old shareware Linguistics routines and I am trying to get a working interface with them. Anyway, How do you SHELL or CHAIN to a .com file? I know CHAIN isn't right because it just shows the weird .com codes. I think that is what CHAIN did, but I'd have to re-do it to see. The two types of files that I am attempting to link to my menu are: .exe and .com files Any advice? Thanks, Gloria
|
Mon, 31 Mar 2003 03:00:00 GMT |
|
 |
Caisso #2 / 25
|
 Need advice on getting out of prog to a .com file
Quote: > Hi, all!
Hello Gloria, You did not tell us what tipe of BASIC you're using, not which OS ... If you are using QBASIC in a DOS environment, you can use SHELL. Like so: shell("filename") That's all. You can type the filename with, or without extention. With, or without a full path in front of it. Just like you would on the Command-line. CHAIN is used to start another BASIC program. Call it loading an Overlay if you wish. Regards, Rudy Wieser Quote: > I am still pluggin away on that umbrella program for my Linguistics > prof. > We have these old shareware Linguistics routines and I am trying > to get a working interface with them. > Anyway, How do you SHELL or CHAIN to a .com file? > I know CHAIN isn't right because it just shows the weird .com codes. > I think that is what CHAIN did, but I'd have to re-do it to see. > The two types of files that I am attempting to link to my menu are: > .exe and .com files > Any advice? > Thanks, > Gloria
|
Tue, 01 Apr 2003 14:58:03 GMT |
|
 |
Tom Lak #3 / 25
|
 Need advice on getting out of prog to a .com file
Quote: > Hello Gloria, > You did not tell us what tipe of BASIC you're using, not which OS ... > If you are using QBASIC in a DOS environment, you can use SHELL. > Like so: > shell("filename")
In QBasic there are no parentheses around the argument. SHELL "filename" is all you need. Tom L
|
Tue, 01 Apr 2003 03:00:00 GMT |
|
 |
Acidu #4 / 25
|
 Need advice on getting out of prog to a .com file
Quote: > CHAIN is used to start another BASIC program. Call it loading an Overlay > if you wish.
While CHAIN does this, RUN is more commonly used to just flat out load and run a new BASIC program. CHAIN differs from run in a few VERY important ways. First of all, RUN allows you to pass in a line number to start the program on. This is a hold over from the older BASICA and GW-BASIC days, however, it can be quite useful if you are developing a few programs that interface with each other. However even better than this is CHAIN CHAIN doesn't close open files/devices. So you can still write to files or devices such as a modem attached to a com port, or a printer port in the program you are CHAINing to without having to close and reopen them. This has a few draw backs. It is rather poor programming, and its quite easy to cause errors this way if you just start the program B without CHAINing in from program A. Only do this if you know what you are doing CHAINing does have some good features though. It allows you to pass variables to the next program. You can use this COMMON statement and declare variables. You can pass these variables between programs. However, If you have alot of data to pass, I recommend the only common statement you have is a string that contains the path and filename of a file that has the rest of the data ~Billy
|
Tue, 01 Apr 2003 03:00:00 GMT |
|
 |
Arargh #5 / 25
|
 Need advice on getting out of prog to a .com file
Quote: >> Hello Gloria, >> You did not tell us what tipe of BASIC you're using, not which OS ... >> If you are using QBASIC in a DOS environment, you can use SHELL. >> Like so: >> shell("filename") >In QBasic there are no parentheses around the argument. >SHELL "filename" >is all you need.
But it works just fine with the parens. -- arargh (at enteract period com) http://www.arargh.com (Reply address points nowhere in an attempt to foil e-mail spammers.)
|
Tue, 01 Apr 2003 03:00:00 GMT |
|
 |
Arargh #6 / 25
|
 Need advice on getting out of prog to a .com file
On Fri, 13 Oct 2000 19:44:08 -0400, "Acidus" Quote:
>> CHAIN is used to start another BASIC program. Call it loading an Overlay >> if you wish. >While CHAIN does this, RUN is more commonly used to just flat out load and >run a new BASIC program. CHAIN differs from run in a few VERY important >ways. First of all, RUN allows you to pass in a line number to start the >program on. This is a hold over from the older BASICA and GW-BASIC days, >however, it can be quite useful if you are developing a few programs that >interface with each other. However even better than this is CHAIN >CHAIN doesn't close open files/devices. So you can still write to files or >devices such as a modem attached to a com port, or a printer port in the >program you are CHAINing to without having to close and reopen them. This >has a few draw backs. It is rather poor programming, and its quite easy to >cause errors this way if you just start the program B without CHAINing in >from program A. Only do this if you know what you are doing >CHAINing does have some good features though. It allows you to pass >variables to the next program. You can use this COMMON statement and declare >variables. You can pass these variables between programs. However, If you >have alot of data to pass, I recommend the only common statement you have is >a string that contains the path and filename of a file that has the rest of >the data
Futher info: Must use an unnamed common. If an .EXE, must use the runtime module 'BRT......' -- arargh (at enteract period com) http://www.arargh.com (Reply address points nowhere in an attempt to foil e-mail spammers.)
|
Tue, 01 Apr 2003 03:00:00 GMT |
|
 |
Xer #7 / 25
|
 Need advice on getting out of prog to a .com file
Quote: >Anyway, How do you SHELL or CHAIN to >a .com file?
Try this: SHELL "drive\directory\whatever.COM" If you want it to exit your program then goto the .COM file, then add either END or SYSTEM below the SHELL and your users may not even notice it unless they view your code. Also, CHAIN is used to run a nother BAS file, which only works when your program is not compiled, I belive.
|
Wed, 02 Apr 2003 03:00:00 GMT |
|
 |
Jure Sa #8 / 25
|
 Need advice on getting out of prog to a .com file
Quote:
> >Anyway, How do you SHELL or CHAIN to > >a .com file? > Try this: > SHELL "drive\directory\whatever.COM" > Also, CHAIN is used to run a nother BAS file, which only works when your > program is not compiled, I belive.
But if your program is compiled you can CHAIN to a EXE or a COM file (says it all in the help, why don't you read it first?). -- Don't feel bad about asking/telling me anything, I will always gladly reply. (99) = A swear word of your choice. GTSC4 -- If nobody else wants to do it, why shouldn't we?(TM) Http://welcome.to/gtsc4/ We're in the United Programers We're also in the United Trackers: Http://www.united-trackers.org
|
Wed, 02 Apr 2003 03:00:00 GMT |
|
 |
Acidu #9 / 25
|
 Need advice on getting out of prog to a .com file
Quote: > Try this: > SHELL "drive\directory\whatever.COM"
You do not need to put a ".com" at the end. when typing a program name, dos checks in the following order: 1-Is is an interenal DOS command? 2-Is it a COM file in the current directory 3-Is it an EXE file in the current directory 4-Is it a BAT file in the current directory 5-Is it a COM file in a PATHed directory 6-Is it an EXE file in a PATHed directory 7-Is it a BAT file in a PATHed directory Quote: > If you want it to exit your program then goto the .COM file, then add either > END or SYSTEM below the SHELL and your users may not even notice it unless they > view your code.
This will waste alot of memory. When you use "Shell" you are temporayily opening a whole new command.com. It has to load it into memory, then the program you want to run. Then when that porgram is done, it will return control to your first Qbasic file, and then it will exit. If you don't need to come back to your original program, create a SUB that stuffs the keyboard buffer with the name of the program you want to run, and a [CR][LF]. Then use System. Now when you quit, DOS takes control, sees their are characters in the keyboard buffer, thinks the usre typed them, and processes them. This will re the program in your CURRET session of command.com, keep intact any TSRs, and otehr things. IF you want more information on how to access the keyboard buffer, I wrote a good artilce on it including code ~Billy Quote: > Also, CHAIN is used to run a nother BAS file, which only works when your > program is not compiled, I belive.
|
Wed, 02 Apr 2003 03:00:00 GMT |
|
 |
Gloria L. McMilla #10 / 25
|
 Need advice on getting out of prog to a .com file
I am experiencing this: I used SHELL and got weird code. I am assuming that somehow it SHELLed to the source code instead of running the 'exe. I OFTEN have trouble with CHAIN and SHELL and don't quite understand them. As stated, my OS is IBM PC and I SHELL to DOS and run Quicjbasic compiler from c:\. I have a cluster of routines, both .com and .exe that I want my menu to allow people to just click and either SHELL or CHAIN out to. Can some one tell why how? I am wondering if the fact that there are BOTH .com and .exes in the list will make it hard to use one command to leave the program.. Thanks, Gloria Quote:
> > Hi, all! > Hello Gloria, > You did not tell us what tipe of BASIC you're using, not which OS ... > If you are using QBASIC in a DOS environment, you can use SHELL. > Like so: > shell("filename") > That's all. You can type the filename with, or without extention. With, > or without a full path in front of it. Just like you would on the > Command-line. > CHAIN is used to start another BASIC program. Call it loading an Overlay > if you wish. > Regards, > Rudy Wieser > > I am still pluggin away on that umbrella program for my Linguistics > > prof. > > We have these old shareware Linguistics routines and I am trying > > to get a working interface with them. > > Anyway, How do you SHELL or CHAIN to a .com file? > > I know CHAIN isn't right because it just shows the weird .com codes. > > I think that is what CHAIN did, but I'd have to re-do it to see. > > The two types of files that I am attempting to link to my menu are: > > .exe and .com files > > Any advice? > > Thanks, > > Gloria
|
Wed, 02 Apr 2003 03:00:00 GMT |
|
 |
Gloria L. McMilla #11 / 25
|
 Need advice on getting out of prog to a .com file
I am using Quickbasic, Tom and others... My OS is IBM-compatible PC and I shell to DOS from WIN 98. Thanks, Gloria Quote:
> > Hello Gloria, > > You did not tell us what tipe of BASIC you're using, not which OS ... > > If you are using QBASIC in a DOS environment, you can use SHELL. > > Like so: > > shell("filename") > In QBasic there are no parentheses around the argument. > SHELL "filename" > is all you need. > Tom L
|
Wed, 02 Apr 2003 03:00:00 GMT |
|
 |
Gloria L. McMilla #12 / 25
|
 Need advice on getting out of prog to a .com file
Hi, Acidus! I would like to read your article. What is its URL or could you email it? Thanks, Gloria ===== Quote:
> > Try this: > > SHELL "drive\directory\whatever.COM" > You do not need to put a ".com" at the end. when typing a program name, dos > checks in the following order: > 1-Is is an interenal DOS command? > 2-Is it a COM file in the current directory > 3-Is it an EXE file in the current directory > 4-Is it a BAT file in the current directory > 5-Is it a COM file in a PATHed directory > 6-Is it an EXE file in a PATHed directory > 7-Is it a BAT file in a PATHed directory > > If you want it to exit your program then goto the .COM file, then add > either > > END or SYSTEM below the SHELL and your users may not even notice it unless > they > > view your code. > This will waste alot of memory. When you use "Shell" you are temporayily > opening a whole new command.com. It has to load it into memory, then the > program you want to run. Then when that porgram is done, it will return > control to your first Qbasic file, and then it will exit. If you don't need > to come back to your original program, create a SUB that stuffs the keyboard > buffer with the name of the program you want to run, and a [CR][LF]. Then > use System. Now when you quit, DOS takes control, sees their are characters > in the keyboard buffer, thinks the usre typed them, and processes them. This > will re the program in your CURRET session of command.com, keep intact any > TSRs, and otehr things. IF you want more information on how to access the > keyboard buffer, I wrote a good artilce on it including code > ~Billy > > Also, CHAIN is used to run a nother BAS file, which only works when your > > program is not compiled, I belive.
|
Thu, 03 Apr 2003 03:00:00 GMT |
|
 |
Acidu #13 / 25
|
 Need advice on getting out of prog to a .com file
What is Keyboard Buffer Stuffing? What Key-stuffing is, is you make the computer think the user type in some keys. You know how the computer can be doing something, and you can type on the keyboard. Then when the computer is done, it can read all those keys you hit. Well, there is a special part of your memory that is called the Keyboard Buffer. When you type a key, it is put in the Buffer. The computer reads from the buffer not the keyboard. So, you can put stuff into this Buffer, and then the computer thinks that the user typed it in. So we need to find where in memory this buffer is. One more thing you need to know about the buffer. Its not an unlimited space. You know that if you mash down on the keyboard, you will get a beeping sound (Its on of the few times you'll hear the speaker insdie your computer). That sound is the computer sayingthat the last character you typed didn't get entered into the buffer, because the buffer is full. I beleive the max length is something like 15 characters Here is a sub in Qbasic that stuff the keyboard buffer with whatever string you pass in to it. SUB StuffBuffer (batch$) 'The keyboard bufffer is only 15 cahrs long, so if batch$ >15, it 'will not all fit in the buffer 'the CHR$(13) which is a carrage return is added to the end of the line so 'that the program name in batch$ will be entered, and dos will run it Stuf$ = batch$ + CHR$(13) Length = LEN(Stuf$) DEF SEG = 0 POKE 1050, 30 'The address of the keyboard buffer POKE 1052, 30 + Length * 2 'tells the computer how much stuff is in the buffer 'STUFF THAT BUFF BABY!!!! FOR a% = 1 TO Length POKE 1052 + a% * 2, ASC(MID$(Stuf$, a%)) NEXT 'Exit Qbasic totally. As soon as your DOS retakes control from Qbasic 'the first thing is notices is that their is some {*filter*}in the keyboard 'buffer. The computer thinks the user typed the stuff in, and thus 'dos displays the letters, and sees that the last character is a 'carrage return, and thus tries to execute what you type. SYSTEM END SUB You Example, if you ran a Qbasic program, and wanted it to go and run DOOM when it quits. You would have call StuffBuffer("DOOM") Here is what happens 1- lalala I'm in DOS look at me la la la 2- You run a qbasic program using "Qbasic /run [filename]" 3- lalala I'm using this program 4- you quit the program 5- Dos gets control back, sees the buffer "DOOM#" where #=chr$(13), and runs DOOM This was covered in an article in a Qbasic newletter I right about vreating a Shell OS. I enjoy writing it, and try to explain pretty advanced things in a very easy way. You can download all 5 issues here: http://www.*-*-*.com/ ~gte344p/QDF1-5.ZIP Or read each one at http://www.*-*-*.com/ ~gte344p/QDF1.TXT http://www.*-*-*.com/ ~gte344p/QDF2.TXT http://www.*-*-*.com/ ~gte344p/QDF3.TXT http://www.*-*-*.com/ ~gte344p/QDF4.TXT http://www.*-*-*.com/ ~gte344p/QDF5.TXT Hope this helps ~Billy
|
Thu, 03 Apr 2003 03:00:00 GMT |
|
 |
Gloria L. McMilla #14 / 25
|
 Need advice on getting out of prog to a .com file
Hi, Acidus! I am able to SHELL to the .com files, but not to the .exe files. They are originally written in fortran or something but are .exe files ... Is this the problem? When outside that program they work fine from the DOS prompt. I could send you the .exe and you could try it. Thanks, Gloria Quote:
> > Try this: > > SHELL "drive\directory\whatever.COM" > You do not need to put a ".com" at the end. when typing a program name, dos > checks in the following order: > 1-Is is an interenal DOS command? > 2-Is it a COM file in the current directory > 3-Is it an EXE file in the current directory > 4-Is it a BAT file in the current directory > 5-Is it a COM file in a PATHed directory > 6-Is it an EXE file in a PATHed directory > 7-Is it a BAT file in a PATHed directory > > If you want it to exit your program then goto the .COM file, then add > either > > END or SYSTEM below the SHELL and your users may not even notice it unless > they > > view your code. > This will waste alot of memory. When you use "Shell" you are temporayily > opening a whole new command.com. It has to load it into memory, then the > program you want to run. Then when that porgram is done, it will return > control to your first Qbasic file, and then it will exit. If you don't need > to come back to your original program, create a SUB that stuffs the keyboard > buffer with the name of the program you want to run, and a [CR][LF]. Then > use System. Now when you quit, DOS takes control, sees their are characters > in the keyboard buffer, thinks the usre typed them, and processes them. This > will re the program in your CURRET session of command.com, keep intact any > TSRs, and otehr things. IF you want more information on how to access the > keyboard buffer, I wrote a good artilce on it including code > ~Billy > > Also, CHAIN is used to run a nother BAS file, which only works when your > > program is not compiled, I belive.
|
Thu, 03 Apr 2003 03:00:00 GMT |
|
 |
Gloria L. McMilla #15 / 25
|
 Need advice on getting out of prog to a .com file
No, they are executables from Pascal. Not FORTRAN. I still cannot SHELL to these .exes and I cannot guess why. I even tried sneaking up on them via a .bat file command. No luck. Why is this happening, anybody? Gloria ======================================== Quote:
> Hi, Acidus! > I am able to SHELL to the .com files, but not to the .exe files. > They are originally written in FORTRAN or something but are .exe files ... > Is this the problem? When outside that program they work fine from > the DOS prompt. > I could send you the .exe and you could try it. > Thanks, > Gloria
> > > Try this: > > > SHELL "drive\directory\whatever.COM" > > You do not need to put a ".com" at the end. when typing a program name, dos > > checks in the following order: > > 1-Is is an interenal DOS command? > > 2-Is it a COM file in the current directory > > 3-Is it an EXE file in the current directory > > 4-Is it a BAT file in the current directory > > 5-Is it a COM file in a PATHed directory > > 6-Is it an EXE file in a PATHed directory > > 7-Is it a BAT file in a PATHed directory > > > If you want it to exit your program then goto the .COM file, then add > > either > > > END or SYSTEM below the SHELL and your users may not even notice it unless > > they > > > view your code. > > This will waste alot of memory. When you use "Shell" you are temporayily > > opening a whole new command.com. It has to load it into memory, then the > > program you want to run. Then when that porgram is done, it will return > > control to your first Qbasic file, and then it will exit. If you don't need > > to come back to your original program, create a SUB that stuffs the keyboard > > buffer with the name of the program you want to run, and a [CR][LF]. Then > > use System. Now when you quit, DOS takes control, sees their are characters > > in the keyboard buffer, thinks the usre typed them, and processes them. This > > will re the program in your CURRET session of command.com, keep intact any > > TSRs, and otehr things. IF you want more information on how to access the > > keyboard buffer, I wrote a good artilce on it including code > > ~Billy > > > Also, CHAIN is used to run a nother BAS file, which only works when your > > > program is not compiled, I belive.
|
Thu, 03 Apr 2003 03:00:00 GMT |
|
|
Page 1 of 2
|
[ 25 post ] |
|
Go to page:
[1]
[2] |
|