home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
w3_disk
/
fc-11f.arj
/
WWWFC4.MN$
< prev
next >
Wrap
Text File
|
1992-07-15
|
4KB
|
113 lines
; This menu file contains a few "more advanced" menu items for
; more experienced users.
; The AutoExec Section on top here.
; Make sure widely used constants are defined!
TAB=num2char(9)
CR=strcat(num2char(13),num2char(10))
Interactive File Commander
if !IsDefined(uyit65) then uyit65=`Message("2+2 is",2+2)`
:NEXT
uyit65=AskLine("Interactive Execution","Enter Command",uyit65)
execute %uyit65%
goto NEXT
Excel DDE Example
;This code makes a multiplication table in Excel via DDE
; Find Excel
a=FileLocate("excel.exe") ; Try brute force path search
if a=="" then a=IniRead("extensions","xls","") ; No? Try via [extensions] section
terminate(a=="","Error","Excel not found") ; Not installed normally
b=strindex(a," ",0,@FWDSCAN) ; Find first space
if b==0 then b=strlen(a)+1 ; None? ...adjust b
b=strsub(a,1,b-1) ; Pick off ^.xls stuff
run(b,"") ; Run Excel
channel = DDEInitiate("Excel", "Sheet1")
Numbers="One Two Three Four Five Six Seven Eight Nine Ten"
offset=1
row=0
:rowloop
col=0
row=row+1
if row > 10 then goto byebye
ThisNum=ItemExtract(row,Numbers," ")
title=row+offset
DDEPoke(channel, "R1C%title%", ThisNum)
DDEPoke(channel, "R%title%C1", ThisNUm)
:colloop
col=col+1
if col > 10 then goto rowloop
expression="=%row%*%col%"
address=strcat("R",row+offset,"C",col+offset)
DDEPoke(channel,address,expression)
goto colloop
:byebye
DDETerminate(channel)
Days between today and ???
;First convert todays date to Julian Equivalent
; extracts separate M, D, and Y variables from DateTime string
; assumes international date format is standard U.S. (MM/DD/YY)
dt = strtrim(DateTime())
dt = ItemExtract(3,dt," ")
dm = ItemExtract(1,dt,"/")
dd = ItemExtract(2,dt,"/")
dy = ItemExtract(3,dt,"/")
; performs the actual conversion
dm = dm + 9
dy = dy + dm / 12 + 399
dm = dm mod 12
today = dy * 365 + dy / 4 - dy / 100 + dy / 400 + (153 * dm + 2) / 5 + dd - 146037
xt=strtrim(AskLine("Day Counter","Enter target date",dt))
xm = ItemExtract(1,xt,"/")
xd = ItemExtract(2,xt,"/")
xy = ItemExtract(3,xt,"/")
; performs the actual conversion
xm = xm + 9
xy = xy + xm / 12 + 399
xm = xm mod 12
other = xy * 365 + xy / 4 - xy / 100 + xy / 400 + (153 * xm + 2) / 5 + xd - 146037
diff=abs(today-other);
Message("Day Counter","%dt% <=> %xt%%CR%Are %diff% days apart")
drop(dt,dm,dd,dy,xm,xd,xy,xt,today,other,diff)
Command Line Calculator
a=AskLine("Calculator","Enter numbers","2+2")
if a=="" then exit
Run("calc.exe","")
ClipPut(a)
Sendkey("+{INSERT}")
SendKey("{ENTER}")
SendKey("^{INSERT}")
WinClose("Calc")
b=ClipGet()
Message("Calc","%a% is%CR%%b%")
_Arrange Windows
&1 Cascade
winarrange(1)
&2 Tile
winarrange(2)
&3 Tile in Rows (4 max)
winarrange(3)
&4 Tile in Columns (3 max)
winarrange(4)