home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 9
/
FreshFishVol9-CD2.bin
/
bbs
/
util
/
zedrexx-1.0c.lha
/
ZedREXX
/
REXX
/
Sneaker.zrx
< prev
next >
Wrap
Text File
|
1994-08-18
|
8KB
|
282 lines
/* Sneaker.zrx
* Written by David N. Junod
*
* This is an incomplete program used to help make sneaker networks a
* little more efficient.
*
*/
OPTIONS RESULTS
SIGNAL ON HALT
/* For Demo Purposes... */
Info("S:",info.)
IF info.DiskState="WRITE_PROTECTED" THEN PersistVol="ENV"
ELSE PersistVol="S"
SrcWild="#?.(c|h|asm|i)"
/******************************/
/* User Interface Description */
/******************************/
/* Application Data */
'zInterface Sneaker Hotkey="ctrl f1" FrontScreen PersistFile='||PersistVol||':Sneaker.zdb'
'zImage Magnify Width=11 Height=9 Depth=1 Data="3E006300C180C180C18063003EC000E00060"'
/* Main Window */
'zWindow Main Label="Sneaker (Hotkey=Ctrl-F1)" Open Centered Vertical CloseEvent ChildMaxWidth'
'zMenu Project'
'zObject Button AboutM Label="About..." Key="?" Cause="zDoMethod About Open"'
'zObject Line'
'zObject Button Hide Label="&Hide" Cause="zDoMethod Sneaker Deactivate"'
'zObject Button Quit Label="&Quit" SelectEvent'
'zEndMenu'
'zMenu Settings'
'zObject Button SetM Label="&Prefs..." Cause="zDoMethod Settings Open"'
'zEndMenu'
'zGroup Horizontal'
'zObject Button Freshen Label="&Freshen..." SelectEvent'
'zObject Button Show Label="&Show" SelectEvent'
'zObject Button SetB Label="&Prefs..." Cause="zDoMethod Settings Open"'
'zEndGroup'
'zObject Line'
/* I shouldn't have to do the FILL switch in the next two objects, but for some
* reason the software is requiring it! */
'zObject ListView Names NumColumns=20 NumLines=10 Order=Ascend ReadOnly Fill'
'zObject Line'
'zObject TextDisplay Status Fill'
'zEndWindow'
/* About Window */
'zWindow About Label="About Sneaker" ChildMaxWidth Centered NoClose'
'zGroup Horizontal Alignment=Center'
'zFill'
'zGroup Vertical'
'zObject StdI Image Which=Information'
'zEndGroup'
'zGroup Vertical ChildMaxWidth'
'zObject TextDisplay A0 Justification=Center Value="Sneaker 0.00001 (2-Aug-94)" NoBorder'
'zObject TextDisplay A1 Justification=Center Value="Copyright © 1994 ITS, Inc." NoBorder'
'zObject TextDisplay A2 Justification=Center Value="Written by David N. Junod" NoBorder'
'zEndGroup'
'zEndGroup'
'zObject Line'
'zGroup Horizontal Justification=Center'
'zObject Button AOK Label="&OK" Cause="zDoMethod About Close"'
'zEndGroup'
'zEndWindow'
/* Warning Window */
'zWindow Warning Label="Sneaker Warning" ChildMaxWidth Centered NoClose Blocking'
'zGroup Horizontal Alignment=Center'
'zFill'
'zGroup Vertical'
'zObject StdI Image Which=Exclamation'
'zEndGroup'
'zGroup Vertical ChildMaxWidth'
'zObject TextDisplay W0 Justification=Center NoBorder Value="Freshen will set the archive"'
'zObject TextDisplay W1 Justification=Center NoBorder Value="bit for all files that match"'
'zObject TextDisplay W2 Justification=Center NoBorder Value=""'
'zEndGroup'
'zEndGroup'
'zObject Line'
'zGroup Horizontal'
'zObject Button WOK Label="&OK" SelectEvent'
'zObject Button WCancel Label="&Cancel" Cause="zDoMethod Warning Close"'
'zEndGroup'
'zEndWindow'
/* Settings Window */
'zWindow Settings Label="Sneaker Settings" Vertical ChildMaxWidth Centered NoClose'
'zGroup Vertical Alignment=Right'
'zGroup Horizontal ChildMaxHeight NoMargX'
'zObject TextEntry TrnDir Persist DropEvent Label="Floppy:" MaxChars=64 NumColumns=32 Value="DF0:" ChangeEvent'
'zObject ButtonG TrnDirS Glyph=Magnify UpEvent'
'zEndGroup'
'zGroup Horizontal ChildMaxHeight NoMargX'
'zObject TextEntry SrcDir Persist DropEvent Label="Source:" MaxChars=255 NumColumns=32 Value="M:"'
'zObject ButtonG SrcDirS Glyph=Magnify UpEvent'
'zEndGroup'
'zGroup Horizontal ChildMaxHeight NoMargX'
'zObject TextEntry Prog Persist DropEvent Label="Executable:" MaxChars=255 NumColumns=32 Value="M:Game"'
'zObject ButtonG ProgS Glyph=Magnify UpEvent'
'zEndGroup'
'zEndGroup'
'zObject Line'
'zGroup Horizontal'
'zObject Button SSave Label="&Save" SelectEvent'
'zObject Button SCancel Label="&Cancel" SelectEvent'
'zEndGroup'
'zEndWindow'
'zEndInterface'
/* Turn everything on */
'zDoMethod Sneaker Activate'
/**************/
/* Event Loop */
/**************/
DO FOREVER
/* Wait for something to happen */
'zWaitForEvent stem.'
/* Do something with the event */
INTERPRET "zRC="RESULT"()"
END
/**************/
/**************/
/**************/
Halt:
Quit_Select:
Sneaker_Quit:
EXIT
Error:
IF RC=20 THEN DO
SAY "Must be run within zrx"
EXIT
END
SAY "Error" RC "at line" SIGL " (errnum="zErrNum")"
EXIT
Main_Close:
'zDoMethod Sneaker Deactivate'
Return 0
/*******************/
/* SETTINGS WINDOW */
/*******************/
TrnDir_Drop:
/* This should somehow figure out the floppy unit!! */
Parse var stem.value first '|' last
'zSetAttr TrnDir Value' first
Return 0
TrnDir_Change:
/*
'zGetAttr TrnDir Value'
TempDriveName=RESULT
SAY Info(TempDriveName,info.)
SAY info.Name info.UnitNumber info.DiskType
*/
Return 0
TrnDirS_Change:
'zGetAttr TrnDir Value'
'zRequest Directory Label "Select Transfer Drive" Value "'result'"'
'zSetAttr TrnDir Value' RESULT
Return 0
SrcDir_Drop:
Parse var stem.value first '|' last
'zSetAttr SrcDir Value' first
Return 0
SrcDirS_Change:
'zGetAttr SrcDir Value'
'zRequest Directory Label "Select Source Drawer" Value "'result'"'
'zSetAttr SrcDir Value' result
Return 0
Prog_Drop:
Parse var stem.value first '|' last
'zSetAttr Prog Value' first
Return 0
ProgS_Change:
'zGetAttr Prog Value'
ProgName=RESULT
IF LENGTH(ProgName)=0 THEN DO
'zGetAttr SrcDir Value'
ProgName=RESULT
END
'zRequest File Label "Select Executable" Value "'ProgName'" ShowPattern Pattern="~(#?.#?)"'
'zSetAttr Prog Value' result
Return 0
SSave_Select:
'zDoMethod Settings Save'
'zDoMethod Settings Close'
Return 0
SCancel_Select:
'zDoMethod Settings Restore'
'zDoMethod Settings Close'
Return 0
/***************/
/* MAIN WINDOW */
/***************/
Freshen_Select:
'zGetAttr SrcDir Value'
'zSetAttr W2 Value' AddPart(RESULT,SrcWild)
'zDoMethod Warning Open'
Return 0
WOK_Select:
'zDoMethod Warning Close'
/* Lock the display so that nothing can happen */
'zDoMethod Sneaker Lock'
'zGetAttr SrcDir Value'
SrcDirectory=RESULT
statMsg="Setting archive bit in directory" SrcDirectory
'zSetAttr Status Value='statMsg
/* What command do you want to hear */
cmd="protect" AddPart(SrcDirectory,SrcWild) "+a quiet"
address command cmd
/* Clear the list view */
'zSetAttr Names Items=""'
/* Unlock the display */
'zSetAttr Status Value="Files freshened"'
'zDoMethod Sneaker Unlock'
Return 0
Show_Select:
/* Lock the display so that nothing can happen */
'zDoMethod Sneaker Lock'
/* Clear the list view */
'zSetAttr Names Items=""'
/* Build the search string & show what's going on */
'zGetAttr SrcDir Value'
SrcDirectory=RESULT
statMsg="Scanning Directory" SrcDirectory
'zSetAttr Status Value='statMsg
SrcDirectory=AddPart(SrcDirectory,SrcWild)
/* Get the directory */
CALL ExAll(SrcDirectory,dirstem.)
/* Place the results of the directory search into the listview */
cnt=0
DO i = 0 TO (dirstem.count - 1)
IF SUBSTR(dirstem.i.protection,4,1)="-" THEN DO
'zDoMethod Names Add' dirstem.i.filename
cnt = cnt + 1
END
END
/* Provide some feedback on how many files we found */
IF cnt=1 THEN statMsg="Found 1 file"
ELSE statMsg="Found" cnt "files"
'zSetAttr Status Value='statMsg
/* Unlock the display */
'zDoMethod Sneaker Unlock'
Return 0