Dots in filenames?

A place to discuss general QL issues.
User avatar
XorA
Gold Card
Posts: 431
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Dots in filenames?

Postby XorA » Mon Feb 20, 2017 2:16 pm

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: 1808
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Dots in filenames?

Postby vanpeebles » Mon Feb 20, 2017 2:20 pm

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
QL Wafer Drive
Posts: 1203
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Dots in filenames?

Postby tofro » Mon Feb 20, 2017 2:40 pm

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


User avatar
XorA
Gold Card
Posts: 431
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Dots in filenames?

Postby XorA » Mon Feb 20, 2017 2:47 pm

Thanks Tobias

That refreshes the old braincells nicely!


User avatar
ql_freak
Trump Card
Posts: 151
Joined: Sun Jan 18, 2015 1:29 am

Re: Dots in filenames?

Postby ql_freak » Wed Feb 22, 2017 11:11 pm

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

Return to “General QL Chat”

Who is online

Users browsing this forum: No registered users and 1 guest