filenames_20containing_20spaces
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
filenames_20containing_20spaces [2018/03/31 13:19] – external edit 127.0.0.1 | filenames_20containing_20spaces [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
//by Richard Russell, May 2006//\\ \\ You don't need to take any special precautions when using **OPENIN**, **OPENOUT** or **OPENUP** to access files whose names (or paths) contain one or more spaces:\\ \\ | //by Richard Russell, May 2006//\\ \\ You don't need to take any special precautions when using **OPENIN**, **OPENOUT** or **OPENUP** to access files whose names (or paths) contain one or more spaces:\\ \\ | ||
+ | <code bb4w> | ||
filename$ = " | filename$ = " | ||
file% = OPENIN(filename$) | file% = OPENIN(filename$) | ||
file% = OPENUP(filename$) | file% = OPENUP(filename$) | ||
file% = OPENOUT(filename$) | file% = OPENOUT(filename$) | ||
+ | </ | ||
However if you need to access such a file with a // | However if you need to access such a file with a // | ||
+ | <code bb4w> | ||
*DISPLAY " | *DISPLAY " | ||
*COPY " | *COPY " | ||
+ | </ | ||
When using **OSCLI** (typically because the filename is a variable rather than a constant) then you must add quotes around the filename(s) in the command string. There are two main ways of doing this, firstly by using the **CHR$34** character: | When using **OSCLI** (typically because the filename is a variable rather than a constant) then you must add quotes around the filename(s) in the command string. There are two main ways of doing this, firstly by using the **CHR$34** character: | ||
+ | <code bb4w> | ||
filename$ = " | filename$ = " | ||
OSCLI " | OSCLI " | ||
Line 15: | Line 20: | ||
dstfile$ = " | dstfile$ = " | ||
OSCLI "COPY " | OSCLI "COPY " | ||
+ | </ | ||
and secondly by using the **"" | and secondly by using the **"" | ||
+ | <code bb4w> | ||
filename$ = " | filename$ = " | ||
OSCLI " | OSCLI " | ||
Line 21: | Line 28: | ||
dstfile$ = " | dstfile$ = " | ||
OSCLI "COPY """ | OSCLI "COPY """ | ||
+ | </ | ||
Forgetting to include the quotes can result in confusing (at first sight) symptoms. Some people find that the method using CHR$34 tends to produce clearer code and is easier to debug. Others prefer the compactness of the "" | Forgetting to include the quotes can result in confusing (at first sight) symptoms. Some people find that the method using CHR$34 tends to produce clearer code and is easier to debug. Others prefer the compactness of the "" |
filenames_20containing_20spaces.1522502359.txt.gz · Last modified: 2024/01/05 00:17 (external edit)