qb45advr.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
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
NAME Statement Programming Example
 
This example shows how to use NAME 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"
 
  Tip: You can also use NAME to move a file from one directory to
       another. You can move README.DOC to the directory MYDIR
       with the following statement:
 
           NAME "README.DOC" AS "MYDIRREADME.DOC"