TIP: Click on subject to list as thread! ANSI
echo: 4dos
to: Christer Jacobsson
from: Jack Stein
date: 1998-11-05 15:23:26
subject: START command in 4os2!

Christer Jacobsson wrote in a message to Jack Stein:

 CJ>> Is there anybody in this conference that has any experience
 CJ>> with this and can post an example DOS settings file that
 CJ>> works with the 4OS2 START command?

 JS> At one time I used to use START to start sessions with specific settings
 JS> for a DOS app, but, that eventually broke, and Rex Conn advised me that
 JS> the methods used to implement this feature of start was undocumented
 JS> and changed around a bit as IBM messed with OS/2.

 JS> The solution is simply to create an icon for the app with whatever DOS
 JS> settings you want in it, then make sure the object has an objectID, then
 JS> use REXX to open the object.  Thats the only way to go, it works great,
 JS> and is easy once you figure out what you need to do.

 CJ> I have just dumped my icon for FDrun.BAT onto the Object
 CJ> Inspector (I'm using Object Desktop 2.0beta2) and asked it
 CJ> to create both an FDrun.CMD and FDrun.RC file. In the
 CJ> FDrun.CMD, which is used to re-create the object, the
 CJ> objedtID is shown as .

 CJ> Now, how do I go about opening (starting) FDrun.BAT from my
 CJ> RUNBBS.CMD with a Rexx file? Remember, RUNBBS.CMD looks like
 CJ> this in the relevant portion: 

Your first problem is you either have a cmd file or a Rexx file.  If you
want RUNBBS.CMD to remain a cmd file, rather than convert it to a Rexx
file, then you would have to create another cmd file that is a REXX file
(you need a REXX script to open an object with Rexx)

 CJ> === Cut ===
 CJ> chcp 850
 CJ> :loop

 CJ> cd \fd
 CJ> FDrun.BAT %task% %port%
 CJ> Call some Rexx file to start FDrun.Bat with parameters
 CJ> %task% & %port% How should the rexx file look like if it's
 CJ> to start FDrun.BAT and passing the above parameters to it?

You threw in a clinker with opening the object and passing parameters to
it.  I'm not sure how you would do that.  I'm not sure why you need a
FDrun.BAT at all?  At the worst, you could have REXX update the object to
contain the parameters in the PARMAMETERS= setting before you open the
object... a subject more suitable to the OS2REXX echo, but other than that:

 :loop
 cd \fd

 :: CJ> FDrun.BAT %task% %port%
 :: CJ> Call some Rexx file to start FDrun.Bat with parameters
 Another.cmd %task %port

That will cause your 4OS2 cmd file to call another.cmd, which is a Rexx script.
Another.cmd will look something like this:

/*Another.cmd - note, this comment MUST be at position 0,0 in the file */

/***  Load Rexx Utilities  ***/
call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
call SysLoadFuncs

/* grab the parameters passed to Another.cmd */
parse ARG Task Port  /* this will set the Task and Port vars to the passed 
                       parameters */

rc = sysopenobject('',0,1)

/*** end of another.cmd ***/

This will open the object assigned to the OBJECTID .  How
you could pass the parameters for Task and Port to the object I don't know.
 I do know how to have REXX update (change) the objects settings though,
and one of the settings is PARAMETERS.  

Perhaps you could stick a SysSetObjectData function before you open the
object to set the parameters:

Rcode = SysSetObjectData('', "PARAMETERS="task port)

This is untested by me, so it may need some messing with, but thats the
general idea.  There may be other methods as well, I never passed PARAMETER
settings to an object myself.   Again, this is stuff for discussion in the
OS2REXX echo more than the 4DOS echo.

Having said all that, there isn't much reason for an OS/2 user to run any
complicated cmd files at all, when REXX is available to them.  By
complicated I mean anything other than opening a file and such.  Generally,
Rexx is much easier to use and a hell of a lot more powerful, opening a lot
of doors not available to the average batch file.
               
                                                   Jack 
--- timEd/2-B11
* Origin: Jack's Free Lunch 4OS2 USR 56k Pgh Pa (412)492-0822 (1:129/171)
SEEN-BY: 396/1 632/0 371 633/260 267 270 371 635/506 728 639/252
@PATH: 129/171 3 11 270/101 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.