|
Post by C128Man on Oct 30, 2019 19:01:24 GMT
Hi,
Is it possible, in BASIC 7.0, to use the command DOPEN with the filename in a variable rather than in a constant?
For example:
10 f$="test"
20 dopen#1,f$,w
30 dclose#1
|
|
|
Post by bjonte on Oct 30, 2019 21:11:03 GMT
I don’t see why not.
|
|
|
Post by C128Man on Oct 31, 2019 7:39:19 GMT
Just like me! But, I've got a "syntax error in 20" :-(
|
|
|
Post by bjonte on Oct 31, 2019 8:25:40 GMT
I’m surprised. Well, you can always fall back to regular OPEN. That supports arguments in variables. I guess it has something to do with the optional argument parsing DOPEN is doing.
|
|
|
Post by C128Man on Oct 31, 2019 10:58:09 GMT
I found the right syntax here. Thank to hydrophilic (my hero )
The correct syntax is :
dopen #1,(f$),w
I don"t know why it must be between parenthesis
|
|