TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Mike Ruskai
date: 1994-07-20 06:40:20
subject: REXX stuff...

I am only guessing that this is the proper echo to discuss REXX, since I 
didn't see an OS/2 REXX echo on the backbone.

Anyway, I haven't gotten into C++ just yet (and only have a shoddy DOS 
compiler at the moment, so won't do anything serious until I can get my 
hands on Watcom or C/Set++), so all I do right now is fiddle in REXX.

I came across a little freeware program that converts Windows icons to OS/2 
format.  It was a command line only program which made it quite difficult 
to do icons in the order of thousands.  So, I devised a small REXX script 
to do a whole directory automatically.  Since then, I have revised it for a 
couple friends to use, and I decided to improve upon it quite a bit.

The converter worked in this format:

CVTICO  

Of course the two had to be different for it to work.

So, what I did was use SysFileTree to get the *.ico files in the directory, 
then process them with the following steps:

icondir='c:\icons'
call directory(icondir)
call SysFileTree 'c:\icons', '*.ico', 'icons.', 'FO'
do convert=1 to icons.0
parse upper var icons.convert current_icon
'cvtico' current_icon 'temp.ico'
'del' current_icon
'ren temp.ico' current_icon '>>' logfile
end

Later, I replaced the DEL with SysFileDelete to clean up a bit, but the 
problem I ran into was that CMD.EXE puked.  Apparently it does not accept a 
full pathname as the second argument.  4OS2.EXE, on the other hand, had no 
problem with it.  So, I kludged it to "detect" for the presence of 4OS2 as 
the command interpreter like this:

'ver > 00000000.txt'
call SysFileSearch '4OS2', '00000000.txt', 'version.'
if version.0=0 then present=0
if version.0>0 then present=1
rc=SysFileDelete('00000000.txt')

Where a value of 1 for present indicated that 4OS2 was present.  It works 
fine, but somehow I think there must be an easier way.  

In the absence of 4OS2, I did this between the 'cvtico'... statement and 
the end statement:

rc=SysFileDelete(current_icon)
'copy temp.ico' current_icon
rc=SysFileDelete('temp.ico')

Obviously, copying and deleting is considerably slower than renaming with 
high volumes.  The only way around this that I can see is to strip the path 
from the current icon being processed.  Is there any way I can do this?

´Mike Ruskai ³ FidoNet(1:107/634) ³ RGSNet(50:130/12) ³ OS/2Net(81:135/30)Ã
´{Team OS/2} ³ ITCnet(85:862/207) ³         TerraNet(87:908/100)          Ã


... If at first you don't succeed, destroy all evidence that you tried.
___ Blue Wave/QWK v2.12 OS/2
--- RG 5-31 Exp/GE 1.02+

* Origin: The Licking Factory, OS/2 in NJ! (908)636-7245 (1:107/634)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 413 430
SEEN-BY: 711/807 808 809 934 942 712/353 623 713/888 800/1
@PATH: 107/634 677 33 3615/50 229/2 12/2442 711/409 54/54 711/808 809 934

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™.