Where in the docs?

Forum for discussion about the documentation project.
Post Reply
owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

Where in the docs?

Post by owen »

Where in the docs does it describe string assignment where the string has quotation marks?

Code: Select all

Print """Hello World"""
Print !"\"Hello World\""
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Where in the docs?

Post by fxm »

owen
Posts: 555
Joined: Apr 19, 2006 10:55
Location: Kissimmee, FL
Contact:

Re: Where in the docs?

Post by owen »

thanks
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: Where in the docs?

Post by bcohio2001 »

Code: Select all

Print Chr(34) + "Hello World" + Chr(34)
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: Where in the docs?

Post by grindstone »

The accepted escape sequences in text are:
\a beep
\b backspace
\f formfeed
\l or \n newline
\r carriage return
\t tab
\unnnn unicode char in hex
\v vertical tab
\nnn ascii char in decimal
\&amphnn ascii char in hex
\&amponnn ascii char in octal
\&ampbnnnnnnnn ascii char in binary
\\ backslash
\(double quote) double quote
\' single quote

Code: Select all

Print !"\&amph23"
output: 'amph23' (should be: '#')

What am I missing?
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where in the docs?

Post by St_W »

grindstone wrote:

Code: Select all

Print !"\&amph23"
output: 'amph23' (should be: '#')

What am I missing?
That's a fault in the documentation. & is the HTML code for & so it should read &h23 (instead of &amph23). I'll try to fix it.
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Where in the docs?

Post by fxm »

St_W wrote:That's a fault in the documentation. & is the HTML code for & so it should read &h23 (instead of &amph23). I'll try to fix it.
TblEscapeSequences:
Look at the last 2 rows of the table that are now exploded into 3 lines in the *.chm file.
IMHO, that is why \" was written before \(double quote).
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: Where in the docs?

Post by grindstone »

Thank you.
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where in the docs?

Post by St_W »

fxm wrote:Look at the last 2 rows of the table that are now exploded into 3 lines in the *.chm file.
IMHO, that is why \" was written before \(double quote).
I feared that something like that happens, but I think that it should be fixed in the CHM rather than worked around on the wiki. I'll try to look into that too.
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Where in the docs?

Post by fxm »

There is other thing that should be fixed in the CHM.
In the index list, the original "&=" string is displayed as "?":
"? (Concatenate And Assign)" instead of "&= (Concatenate And Assign)"
"Operator ? (Concatenate And Assign)" instead of "Operator &= (Concatenate And Assign)"
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where in the docs?

Post by St_W »

fxm wrote:There is other thing that should be fixed in the CHM.
In the index list, the original "&=" string is displayed as "?"
Thanks for the hint; I'll look into that too.
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where in the docs?

Post by St_W »

Submitted a PR that should fix the encoding issues: https://github.com/freebasic/fbc/pull/49

//edit:
PR has been accepted by dkl and he also noted that some fixes may be necessary (thanks!).
I found only one additional page (to the one mentioned by dkl), which needed to be fixed anyway because they were broken in the online-wiki. The changed pages are:
https://freebasic.net/wiki/wikka.php?wa ... Printusing
https://freebasic.net/wiki/wikka.php?wa ... PgCruntime

If there are any other pages broken by the change please report the errors (or fix them).

From now on please use proper HTML escape sequences in the wiki instead of the previously used workaround with the missing semicolon (e.g. "&" instead of "&amp"). However, in general I'd suggest to avoid the use of HTML escape sequences altogether when possible because of the very limited support in the fbdoc application (which generates the txt/chm/fbhelp help files).
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Where in the docs?

Post by fxm »

St_W wrote:
fxm wrote:Look at the last 2 rows of the table that are now exploded into 3 lines in the *.chm file.
IMHO, that is why \" was written before \(double quote).
I feared that something like that happens, but I think that it should be fixed in the CHM rather than worked around on the wiki. I'll try to look into that too.
Now, also the similar problem in .chm file for the tables of the two recently updated pages in wiki:
(TblEscapeSequences)
+ KeyPgPrintusing
+ ProPgCruntime
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Where in the docs?

Post by St_W »

fxm wrote:Now, also the similar problem in .chm file for the tables of the two recently updated pages in wiki
The PR has been merged into the master branch now, which should fix:
- the HTML character escaping issues (TblEscapeSequences, KeyPgPrintusing, ProPgCruntime)
- the page title character escaping issues in the CHM (e.g. "Operator &= (Concatenate And Assign)")
- the character encoding issues in the CHM (e.g. on the "Table of ASCII Characters" page)
and some little issues with the documentation build application itself.
fxm
Moderator
Posts: 12110
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Where in the docs?

Post by fxm »

Thank you very much.
It's perfect now.
Post Reply