Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:12 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Getting filenames from users?

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9307
Posted: 05:40pm 03 Mar 2013
Copy link to clipboard 
Print this post

Hi.

I have a line input for the filename, then try to put it into the command, and am getting syntax errors.


line input m$
if m$="" then goto start
open "B:\DATA\";m$;".TXT" for input as #1


The open command fails.

If I enter the command directly in the command prompt like this:

? "B:\DATA\";m$;".TXT"

Then if m$ was ABCD, then the print statement comes out as B:\DATA\ABCD.TXT

Shouldn't that be working?

EDIT: Found something in manual page 4 under expressions - trying it out...

EDIT: Disregard this thread.

added f$ into the mix:

f$="B:\DATA\" + m$ + ".TXT"
open f$ for input as #1


I'm having fun today. Edited by Grogster 2013-03-05
Smoke makes things work. When the smoke gets out, it stops!
 
shoebuckle
Senior Member

Joined: 21/01/2012
Location: Australia
Posts: 189
Posted: 05:54pm 03 Mar 2013
Copy link to clipboard 
Print this post

Grogster,
Replace the semicolons in your Open statement with plus signs. This concatenates the three strings.
Hugh
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 07:01pm 03 Mar 2013
Copy link to clipboard 
Print this post

Also, for one-line IF statements like the top example, you don't need the "THEN" just a GOTO or GOSUB.

i.e.
if m$="" then goto start.......can be:
if m$="" goto start
Edited by paceman 2013-03-05
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024