QBASIC CODE:


General TIPS:
  o Comments are EITHER by REM or by SINGLE QUOTE (')
  o Paragraph names END with COLON (:)
  o Paragraph names can have NO underbar (_)
  o To set comments for SELF DOCUMENTING via
    Find "#d#" filename, use the following comment line:
    REM #D# Self documenting line

REM getting value of PATH  from environment into symbol CurPath$
CurPath$ = ENVIRON$("PATH")


REM Getting user INPUT PRINT STRING$(78, "=") ' print a line of 78 EQUAL (=) LINE INPUT ; "::: ENTER your LAST name: "; LastNam$: PRINT ' Above line gets users input into symbol LastNam$

REM reading contents of an existing file FileNam$ = "\usr\randy\sample.txt" ' set file into a symbol LineCtr = 0 ' set value tp 0 ' ' On NEXT line the file is opened for READ, and each line is read ' into the symbol InLine$, and the # of lines is counted ' OPEN FileNam$ FOR INPUT AS #1 DO WHILE NOT EOF(1) LINE INPUT #1, InLine$ ' do whatever to contents in symbol InLine$ LineCtr - LineCtr + 1 LOOP CLOSE #1

REM Issuing an operating system command FileSpec$ = "\usr\randy\oldfile.txt" ' define a symbol NewSpec$ = "\usr\share\now4you.txt" ' define a symbol ' ' build a symbol containing "MOVE \usr\randy\file1.txt \usr\share\file2.txt ' ShellCommand$ = "MOVE " + FileSpec$ + " " + NewSpec$ + ">NUL:" SHELL ShellCommand$ ' ' OR if simple enough ' SHELL "MOVE \usr\randy\file1.txt \usr\share\file2.txt>NUL:"

Return to Randys HOME PAGE
Created Mar 04, 1996 ~ Updated: Aug 09, 1996
© 1996 R.D.RISHER