CREATE _VERSION_ 256 ALLOT _VERSION_ 256 BLANK CREATE _CWD_ 256 ALLOT _CWD_ 256 BLANK [DEFINED] GetCurrentDirectory [IF] 256 _CWD_ 1+ GetCurrentDirectory DUP 256 = [IF] \ VFX Forth stores a counted string. DROP \ Drop useless limit _CWD_ 1+ DUP C@ \ Move count down by one _CWD_ SWAP CMOVE \ Chars follow after [ELSE] \ SwiftForth expected the limit, left a count. _CWD_ C! \ Store the count [THEN] [ELSE] [DEFINED] current-dir$ [IF] \ Win32Forth current-dir$ COUNT _CWD_ SWAP CMOVE [ELSE] \ gForth not yet figured out. [THEN] [THEN] CR ." CWD: " _CWD_ COUNT TYPE FALSE [IF] \ >>>>> VFX Forth <<<<< PAD GetCurrentDirectory \ >>>>> gForth <<<<< S" PWD" system [THEN]