Dots in filenames?

A place to discuss general QL issues.
Post Reply
User avatar
XorA
Site Admin
Posts: 1358
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Dots in filenames?

Post by XorA »

Whats the deal with these on QDOS, I remember seeing the reason they are not allowed once upon a time. But can't remember it!


User avatar
vanpeebles
Commissario Pebbli
Posts: 2816
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Dots in filenames?

Post by vanpeebles »

I think you need to use " " around a filename with a . in it, on a BBQL, and sometimes then I found it a bit fussy. I always avoid them and change it to _ first when using zips etc.


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Dots in filenames?

Post by tofro »

QL S*Basic accepts two different variable types for filenames - Strings and Names

A string is typically either a variable of type string (marked by the "$" sign) or a string constant enclosed in single or double quotes. Once you put the string in quotes, S*Basic will accept basically any character in the file name, dots included.

To simplify file name input, S*Basic accepts names as well - Those need to follow the naming conventions (same as variable names) of S*Basic and may thus not contain dots and certain other special characters. Such names are also entered into the S*Basic name table and keep their case while the QL runs.

So, if you got a filename that includes special characters other than letters, numbers and underscore characters like dots, question or exclamation marks and the like, simply enclose it in quotes.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
XorA
Site Admin
Posts: 1358
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Dots in filenames?

Post by XorA »

Thanks Tobias

That refreshes the old braincells nicely!


User avatar
ql_freak
Gold Card
Posts: 353
Joined: Sun Jan 18, 2015 1:29 am

Re: Dots in filenames?

Post by ql_freak »

With SBASIC on SMSQ/E (e.g. with QPC2 emualator) you can now use the fullstop ('.') in SuperBASIC names, and so you also can enter pathnames with fullstop without need for quotes. Albeit I recommend always to use quotes in SuperBASIC, as else every time you use a name, a name table entry is created for each unquoted filename.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Post Reply