Some explanation of this script can be found here. NB.* SDDir.ijs: Source/Destination directory specification.

usuinit=: 0 : 0

)

coclass 'srcdest' load 'dirbrowse logger' NB. See "Scripts/logger.ijs"

DEBUGON=: 0 NB. 0 no debug, 1 debug NB. INITFL=: 'SDDir.ini',~getTempDir NB. Keep window field values here

SDDIR=: 0 : 0 pc sddir; pn "Source and Destination Directories"; xywh 240 8 34 12;cc ok button;cn "OK"; xywh 240 23 34 12;cc cancel button;cn "Cancel";

xywh 2 6 40 12;cc inpBoxSD static;cn "Source Directory"; xywh 60 6 115 12;cc SDsrcd edit; xywh 190 6 34 12;cc brwsSrc button;cn "Browse";

xywh 2 23 60 12;cc inpBoxDD static;cn "Destination Directory"; xywh 60 23 115 12;cc SDdestd edit; xywh 190 23 34 12;cc brwsDest button;cn "Browse";

xywh 12 40 150 12;cc inpBoxMsg static;cn "Enter directories"; pas 6 6;pcenter; rem form end; )

sddir_handler=: 3 : 0

NB. SDHWNDP=: wd 'qhwndp;' NB. Initialize entry fields here...

NB. Put current values or explanatory text in the entry fields.

NB. Our very own event loop.

NB. This is the key: assign the entire queue to "wdq" and

NB. assign every variable in 1st column to its value in the 2nd column.

NB. Treat enter in an input field just like pressing OK.

)

sddir_ok_button=: 3 : 0 NB.* sddir_ok_button: set source and destination directory values: SRCDIR & DESTDIR. NB. ({."1 wdq)=: {:"1 wdq

NB. Ensure dirs end with path separator (i.e. '/').

)

sddir_brwsSrc_button=: 3 : 0

)

sddir_brwsDest_button=: 3 : 0

)

sddir_close=: 3 : 0

)

sddir_cancel_button=: 3 : 0

)

coclass 'base'

Scripts/sddir.ijs (last edited 2008-12-08 10:45:51 by )