bas7ex.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
NAME Statement Programming Example
                       Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
'This example uses the NAME statement to rename your README.DOC file.
 
CLS    'Clear screen.
'Change README.DOC to READMINE.DOC.
NAME "README.DOC" AS "READMINE.DOC"
FILES  'Display the files in your directory to confirm name change.
PRINT
PRINT "README.DOC is now called READMINE.DOC"
PRINT "Press any key to continue"
DO
LOOP WHILE INKEY$ = ""
'Change name back to README.DOC and confirm by displaying files.
NAME "READMINE.DOC" AS "README.DOC"
FILES
PRINT
PRINT "README.DOC is back to its original name"