home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Utilities
/
QuickFile
/
ARexx
/
SetCycle.quickfile
< prev
next >
Wrap
Text File
|
2000-05-28
|
2KB
|
75 lines
/*
$VER: SetCycle.quickfile 1.0 (29 May 2000 01:48:24) By M Andre Z Eckenrode
Opens a listview requester (via 'RxListReq' by Robert Dickow) displaying all
available values for a cycle field, with which a new value for the field may be
selected, if the number of available values for the field exceeds the variable
<maxvalues> below (change as desired); or, sets the field to its next, or
first, value, if the number of values is less than or equal to <maxvalues>.
Ideal for use with function keys.
Requires QuickFile v3.24 or higher, the name of the cycle field as an argument,
and 'rexxsupport.library' and 'RxListReq' (available from Aminet in util/rexx),
which must reside in the command path, if the requester is to be opened.
*/
options results
fld = upper(arg(1))
query field 'FLD "'fld'"'
if rc = 5 then do
reqmsg '"Field \039'fld'\039 not found."'
exit
end
else if upper(fld.type) ~= 'CYCLE' then do
reqmsg '"\039'fld'\039 not a cycle field."'
exit
end
query cycle 'FLD "'fld'"'
maxvalues = 5
/*
Change the value 'maxvalues' above as desired to automatically cycle forward
for cycle fields with fewer or more available values.
*/
if fld.0 <= maxvalues then do
getfield '"'fld'"'
val = result
query cycle 'FLD "'fld'"'
do i = 1 to fld.0 while fld.i ~== val
nop
end
if i < fld.0 then i = i+1
else i = 1
val.sel = fld.i
end
else do
port = 'RXLISTREQ'
if ~show('p',port) then do
address command 'run rxlistreq'
lib = 'rexxsupport.library'
if ~show('l',lib) then call addlib(lib,0,-30)
do 50 while ~show('p',port)
call delay(5)
end
end
do i = 1 to fld.0
ii = i-1
val.ii = fld.i
end
rxlv.lvlabel = 'Select new value for '''fld'''.'
rxlv.width = 250 /* Adjust this value to accomodate your screen font */
rxlv.height = 200
address 'RXLISTREQ' rxlistreq fld.0 val
if rxlv.exit ~== 'LIST' then exit
sel = rxlv.clicked
end
putfield '"'fld'" "'val.sel'"'
updrec