TIP: Click on subject to list as thread! ANSI
echo: os2user-l
to: All
from: Herbert Rosenau
date: 2005-04-03 13:27:42
subject: Re: REXX - New Trick Not Working

Don{ald} O. Woodall schrieb:
> Hello Herbert
> 
>      I've been awake all night and should be sleeping now.
> 
>      In an attempt to learn, I have hacked away at a program
> and produced the following file/program.
> 
> /*       The name of this file is:  drive-f-dir-lst-mak.Cmd        */
/*                                                                
> */
> Q:

you means
oldpath = directory() /* note the directory wa are currently in */

You are sure the drive drive q: exists?

As you tries to use functions from REXXUTIL.DLL you must be sure that 
they are loades, so after the startup comment you needs the following 
lines:

/* we need the rexxutils, so load them when not already done */
rc = RxFuncAdd('SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs')
if rc > 1 then do
    say ''
    say 'Unable to Add Function SysLoadFuncs from DLL RexxUtil (rc = 
'rc')'
    say 'Please insure that the REXXUTIL.DLL exists in a subdirectory 
contained'
    say 'in the LIBPATH statement in your CONFIG.SYS file.'
    exit
end
else call SysLoadFuncs


Then you means

-------------blah.cmd--------------------
/* a little procedure to create a number of directories */

/* list of directories to create */
dirlist.0 = 4    /* number of directories to create */
dirlist.1 = "q:\APPS"
dirlist.2 = "q:\CONFIGHIS"
dirlist.3 = "q:\DESKTOP"
dirlist.4 = "q:\DOWNLOAD"
/* extend to your needs and change dirlist.0 to the number you ends up */


logpath = "c:\mkdir.log"  /* path and name of logfile */


do i = 1 to dirlist.0
   rc = sysmkdir(dirlist.i)
   if rc != 0 0 then do
        /* unable to create directory put out  the error on both 
screen and logfile */
       errtx = "create directory "dirlist.i" failed with rc = "rc
       say errtx
       rc = lineout(logpath, errtx)
    end
    else do
        /* directory successfully created. Note it to both screen and 
logfile */
       errtx =  dirlist.i" created"
       say errtx
       rc = lineout(logpath, errtx)
    end
end
/* work done close logfile */
rc = stream(logpath, "C", "CLOSE")
-------------end blah.cmd-----------

instead of:

> CALL sysmkdir "APPS"
> CALL sysmkdir "CONFIGHIS"
> CALL sysmkdir "DESKTOP"
> CALL sysmkdir "DOWNLOAD"
> 
>      I didn't have the "CALL" in there the first time and got 1,848
> sys1041 error messages.

This is misleading. Dos you mean that the whole lines are not there or 
that only the word "call" is left off?

sysmkdir returns either success or a number of differen error numbers. 
Don't use call when a function tries to return an error! Use the 
fuction form instead.

When you CALL a procedure you needs to write the CALL. When you lefts 
off that word REXX calls cmd.exe itself to send it the line as command 
- but there is no command that is named sysmkdir (in any case) so 
cmd.exe (or what ever your OS2SHELL in config.sys points to give the 
error 1041.

>      With the "CALL" statement in there, the screen goes
blank for a few
> seconds while the program runs, but nothing happens.

Looks like you have no drive Q: or Q: is not formatted well or is full 
or.....

That is why you should NOT 'CALL' sysmkdir but call it as function. 
and check its return value.

>      I am all for getting this to work so I don't have to break into
> pieces and create directories one nested level at a time.
> 
>      I am not working at being stubborn or resistant,  I just have trouble
> tuning into your frequency and understanding what you are talking about.

Again learn to understund the procedure I've sent you already as it 
will avoid you from lots of typing errors, missing files and 
directories after copying a drive to another as this way will have 
always, regardless how often you checks all the 18xx or 24xx or xxxx 
directories you will handle manually.


-- 
Tschau/Bye

Herbert Rosenau                    eCS 1.2 Deutsch bestellen bei
EDV Beratung & Programmierung           http://pc-rosenau.de
Eichelsdorfer Str. 15                   http://ecomstation.de
97461 Hofheim i.UFr.

Tel: 49-9523-502834
Fax: 49-9523-502823                     http://www.dv-rosenau.de/


 
Yahoo! Groups Links

 To visit your group on the web, go to:
    http://groups.yahoo.com/group/os2user/

 To unsubscribe from this group, send an email to:
    os2user-unsubscribe{at}yahoogroups.com

 Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




---
* Origin: Waldo's Place USA Internet Gateway (1:3634/1000)
SEEN-BY: 633/267 270 5030/786
@PATH: 3634/1000 12 106/2000 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™.