home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 61
/
af061a.adf
/
Macros
/
MakeFileGadgets.clssa
< prev
next >
Wrap
Text File
|
1993-05-01
|
2KB
|
67 lines
/***********************************************************************
$DAT >>MakeFileGadgets.clssa<< 01 May 1993 - (C) ProDAD Holger Burkarth
Searces for files with the label ".clssa" in the selected path. If
only one file can be found, which has the keyword "GADGET:" in the
first ten lines then this file will be displayed as Gadget. The
gadget name must appear in quotes behind the keyword. After this
comes the 'page', also in quotes, followed by the preferred gadget
position or, alternatively, "AUTO".
************************************************************************/
Options RESULTS
PARSE ARG InputVar
IF Open(gaddef,"clariSSA.gadgets",'Write') THEN DO
call Writeln(gaddef,"GADGETS")
DO FOREVER
PARSE VAR InputVar filename InputVar
IF filename="" THEN IF ARG~="" THEN LEAVE
GFail=0
IF filename ="" THEN DO
GetDirectory 'REQ NAME "REXX:" TITLE "ARexx Module as GADGETS" FULL FILES'
END; ELSE DO
GetDirectory 'NAME' filename 'TITLE "ARexx Module as GADGETS" FULL FILES'
END
Files=result
IF rc~=0 | Files="0" THEN exit
PARSE VAR Files pos Files
DO FOREVER
PARSE VAR Files 'FILE "' Name '"' Files
IF INDEX(Name,".clssa") > 0 THEN DO
GadName=""
IF Open(loadit,Name,'Read') THEN DO
Zeile=1
DO FOREVER
Zeile=Zeile+1
string = Readln(loadit);
IF string = "" | Zeile >= 10 THEN LEAVE
PARSE VAR string . 'GADGET: "' GadName '" "' GPage '"' GPos 'TYP: "' Type '"' .
IF GadName~="" THEN DO
call Writeln(gaddef," GADGET PAGE" GPage GPos GadName "ARexxMacro NAME '"Name"'")
GADGET "PAGE" GPage GPos GadName "ARexxMacro NAME '"Name"'"
IF rc > 0 THEN GFail=1
LEAVE
END
END
CALL Close(loadit);
END
IF GFail > 0 THEN LEAVE
END
IF Files="" THEN LEAVE
END
END
call Writeln(gaddef,"#")
CALL Close(gaddef);
END
ELSE Message "'Unknown Error ?????'"
RemakeDisplay 'GADGETS'
exit