>I know some message about a runtime command window have been post (including from me a while back) but I am still looking for a way to provide some fox command capabilities in a distributed app. Previously I use accept and eval to simulate a command function (not pretty and not wise to use accept in visual). Now we are 100% classes and this doesn't work any more (cannot control where the results of a &cmd go) Ideally I would like to find a 'command class' object either home grown, shareware, or licenced. Any ideas - all appreciated!!!
I don't know if it is exactly what you need but I send you a prg that we use in distributed app. When run we can type command like use, browse, reindex, index on, list, etc...... We use that code to repair or debug application.
parameters rep
set talk off
set echo off
if type("rep")="C"
if file(rep+"\nul")
set default to &rep
endif
endif
clear
max_tb = 24
dime tb_comm[max_tb]
for ctr = 1 to max_tb
tb_comm[ctr]=space(254)
next
pos_max = 1
point = 1
comm = space(254)
do while 2=2
if .not. empty(comm)
if "L" = upper(alltrim(comm))
clear
for ctr=1 to pos_max
@ ctr,0 say left(alltrim(tb_comm[ctr]),79)
next
else
comm = alltrim(comm)
&comm
if pos_max>(max_tb-1)
for ctr = 1 to (max_tb -1)
tb_comm[ctr] = tb_comm[ctr+1]
next
pos_max = (max_tb -1)
endif
tb_comm[pos_max] = left(comm+space(254),254)
pos_max = pos_max + 1
endif
endif
comm = space(254)
point = pos_max
do def_cle
@ 01,00 say "Commande:" get comm function "S69"
read
on key
enddo
procedure def_cle
on key label uparrow do up
on key label dnarrow do down
return
procedure up
on key
point = point -1
point = max(point,1)
comm = tb_comm[point]
do def_cle
return
procedure down
on key
point = point + 1
point = min(point,pos_max)
comm = tb_comm[point]
do def_cle
return
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only