From: Jos v.d.V. <jo...@us...> - 2007-07-07 14:26:18
|
Update of /cvsroot/win32forth/win32forth-stc/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24561 Modified Files: extend.f primutil.f Log Message: Jos: Added shell.f. for the help menu. Other words also work. Index: primutil.f =================================================================== RCS file: /cvsroot/win32forth/win32forth-stc/src/primutil.f,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** primutil.f 6 Jul 2007 09:06:39 -0000 1.36 --- primutil.f 7 Jul 2007 14:26:15 -0000 1.37 *************** *** 383,386 **** --- 383,424 ---- ; + + \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + \ LONG counted string support + \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + (( + \ March 2nd, 2000 - 11:14 tjz + You must not store more than 4k beyond where you currently are into the + stack, and since LMAXCOUNTED is passed to LOCALALLOC: a bunch of times in + WinEd, we must limit long counted strings to significantly less than + the 4k limit. So, I am limiting long counted strings to 3k bytes. + )) + + 1024 CONSTANT LMAXCOUNTED \ lines can be 1k characters long + LMAXCOUNTED 2 CELLS+ CONSTANT LMAXSTRING + \ room for leading cell count and trailing cell null + + : "LCLIP" ( a1 n1 -- a1 n1 ) \ clip a string to between 0 and LINE-MAX + LMAXCOUNTED MIN 0 MAX ; + + : LPLACE ( addr len dest -- ) + SWAP "LCLIP" SWAP + 2DUP 2>R + CELL+ SWAP MOVE + 2R> ! ; + + : +LPLACE ( addr len dest -- ) \ append string addr,len to LONG counted + \ string dest + >R "LCLIP" LMAXCOUNTED R@ @ - MIN R> \ clip total to LINE-MAX string + 2DUP 2>R + LCOUNT CHARS + SWAP MOVE + 2R> +! ; + + : C+LPLACE ( c1 a1 -- ) \ append char c1 to the LONG counted string at a1 + 1 OVER +! LCOUNT + 1- C! ; + + : +LNULL ( a1 -- ) \ append a NULL just beyond the counted chars + LCOUNT + 0 SWAP C! ; + \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ Limited support for the '#define' statment from 'C' Index: extend.f =================================================================== RCS file: /cvsroot/win32forth/win32forth-stc/src/extend.f,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** extend.f 5 Jul 2007 20:06:05 -0000 1.25 --- extend.f 7 Jul 2007 14:26:15 -0000 1.26 *************** *** 43,46 **** --- 43,61 ---- FLOAD src\lib\BROWSEFLD.F \ SHBrowseForFolder() support + FLOAD src\Shell.f \ load SHELL utility words + + create config$ ," WIN32FOR.CFG" + create userconfig$ ," WIN32FORUSER.CFG" + + \ ........ set the default system access strings .......... + \ -rbs make shell work in other drives + : set-shell + winver winnt351 >= + if s" CMD.EXE " + else s" c:\command.com " then + 2dup dos$ place shell$ place + s" /c " shell$ +place ; + set-shell + FLOAD src\console\ConsoleMenu.f |