Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User chooses which file to open
#2
Sure just use a string variable like FileName$ in the open statement instead of a literal value.

Create a menu display for the user and use SELECT CASE:

Code:
DO: choice$ = INKEY$ : LOOP UNTIL choice$ <> ""

SELECT CASE choice$
         CASE "1": Filename$ = "ABCD.txt"
         CASE "2": Filename$ = "EFGH.txt"
END SELECT

Then open the file: OPEN Filename$ FOR INPUT AS #1

Get my QB demonstrator here: http://dl.dropbox.com/u/8440706/Q-Basics.zip
Reply


Messages In This Thread
User chooses which file to open - by Licentia - 07-03-2009, 08:20 AM
Re: User chooses which file to open - by Clippy - 07-03-2009, 08:54 AM
Re: User chooses which file to open - by Licentia - 07-03-2009, 09:20 AM
Re: User chooses which file to open - by Clippy - 07-03-2009, 11:29 PM
Re: User chooses which file to open - by Licentia - 07-04-2009, 11:27 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)