Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User chooses which file to open
#3
Thanks for your speedy response!

Sorry that I am not more clear about what I am trying to do. I don't want the user to choose from a list of options. I want the user to select any file they want as long as it's in the same file folder on the computer as the program is located.

You know, I can compile the program and put it in any folder on my computer (run it in DosBox on Ubuntu Linux), and then put a text file in that same folder and the program will open that text file. This way people can name the text file whatever they want.

PS: I found this bit of code online, and I don't like it:

Code:
INPUT "CHOOSE THE FILE YOU NEED", FILE$
Rem      CLS
         FILE$ = "c:\data\" + FILE$ + ".PRF"
         Open FILE$ For Input As #3

I hope it's not saying that I need to pre-select a location for any file that I input as this isn't going to happen in Ubuntu. Unless DosBox somehow assigns a default location?

Is there not a simple way to have QB just check for files in the same location that it is in without having to specify?

I tried this code here but it won't work:

Code:
DO
DO

  PRINT " Please enter the name of the file you are working with."
  PRINT ""
  INPUT FILE.CHOICE$
  PRINT ""
  PRINT " Did you type the file name correctly? Choose 'Y' or 'N'."
  PRINT ""
  INPUT OPTION.3$

LOOP UNTIL OPTION.3$ = "Y" OR OPTION.3$ = "y" OR OPTION.3$ = "N" OR OPTION.3$ = "n"

PRINT ""
PRINT " If the file name is correct, type 'correct'."
PRINT ""
INPUT OPTION.3$

LOOP UNTIL OPTION.3$ = "CORRECT" OR OPTION.3$ = "Correct" OR OPTION.3$ = "correct"

  OPEN FILE.CHOICE$ FOR INPUT AS #1

If it's not possible let me know so I can get on with my life!

Thanks!

Licentia
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)