home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
DATABASE
/
DSCALC.ZIP
/
DSKEYS.SC
< prev
next >
Wrap
Text File
|
1990-01-23
|
4KB
|
236 lines
;-- this utility procedure is used to re-define the keys used in DSCalc.
;-- by changing the key types and the source code of the calculator,
;-- keys can be mapped to change their action in the calculator
;-- if you attempt to do this, a full understanding of the program is
;-- required
;-------------------------------------------------------------------------------
; ds.keys.u()
;-------------------------------------------------------------------------------
; purpose: used to modify the keys accepted by the DSCalc program
proc ds.keys.u()
;-- start with a clean slate
reset
;-- place the key table on the workspace in coedit mode
coedit "dskeys"
;-- no modifications to the key fields
imagerights update
;-- wait until [f2] or [esc]
;-- normally would trap for other keys such as dos and dosbig
;-- but for this simple procedure, I left it as simple as possible
wait table
prompt "Modify the keys as required.",
"Press [F2] when done, [Esc] to cancel."
until -60, 27
imagerights
do_it!
if retval = 27 then
reset
return
endif
reset
clear
echo normal
create "answer"
"keyspec" :"a80"
view "answer"
view "dskeys"
moveto [ascii code]
coeditkey
;-- scan the table and build the variables ds.neg.key.a and
;-- ds.pos.key.a
moveto "answer"
[keyspec] = "ds.neg.key.a=\""
sleep 500
moveto "dskeys"
xx = ""
for x from 0 to -63 step -1
zoom
select x
if upper(window()) <> "match not found" then
xx = xx + lower(substr([dscalc function],1,1))
else
xx = xx + "i"
endif
endfor
xx = lower(xx)
moveto "answer"
[] = [] + xx + "\"+"
down
[] = " \""
sleep 500
moveto "dskeys"
xx = ""
for x from -64 to -127 step -1
zoom
select x
if upper(window()) <> "match not found" then
xx = xx + lower(substr([dscalc function],1,1))
else
xx = xx + "i"
endif
endfor
xx=lower(xx)
moveto "answer"
[] = [] + xx + "\"+"
down
[] = " \""
sleep 500
moveto "dskeys"
xx = ""
for x from -128 to -132 step -1
zoom
select x
if upper(window()) <> "match not found" then
xx = xx + lower(substr([dscalc function],1,1))
else
xx = xx + "i"
endif
endfor
xx = lower(xx)
moveto "answer"
[] = [] + xx + "\""
down down
"ds.pos.key.a=\""
sleep 500
moveto "dskeys"
xx = ""
for x from 1 to 64
zoom
select x
if upper(window()) <> "match not found" then
xx = xx + lower(substr([dscalc function],1,1))
else
xx = xx + "i"
endif
endfor
xx = lower(xx)
moveto "answer"
[] = [] + xx + "\"+"
down
[] = " \""
sleep 500
moveto "dskeys"
xx = ""
for x from 65 to 128
zoom
select x
if upper(window()) <> "match not found" then
xx = xx + lower(substr([dscalc function],1,1))
else
xx = xx + "i"
endif
endfor
xx = lower(xx)
moveto "answer"
[] = [] + xx + "\"+"
down
[] = " \""
sleep 500
moveto "dskeys"
xx = ""
for x from 129 to 192
zoom
select x
if upper(window()) <> "match not found" then
xx = xx + lower(substr([dscalc function],1,1))
else
xx = xx + "i"
endif
endfor
xx = lower(xx)
moveto "answer"
[] = [] + xx + "\"+"
down
[] = " \""
sleep 500
moveto "dskeys"
xx = ""
for x from 193 to 255
zoom
select x
if upper(window()) <> "match not found" then
xx = xx + lower(substr([dscalc function],1,1))
else
xx = xx + "i"
endif
endfor
xx = lower(xx)
moveto "answer"
[] = [] + xx + "\""
sleep 500
do_it!
reset
;-- export the answer table to a script file
menu {tools} {exportimport} {export} {ascii} {text} {answer} {dskeyspc.sc}
if lower(menuchoice()) = "cancel" then
{replace}
endif
delete "answer"
beep
message "Done!"
sleep 1000
endproc
ds.keys.u()