Visio Guy

Visio Discussions => Programming & Code => Topic started by: Visio Guy on April 28, 2008, 08:58:14 AM

Title: Workaround For Problem Posting Code With "Chr (34)"
Post by: Visio Guy on April 28, 2008, 08:58:14 AM
Hi All,

I've found that code snippets with "Chr (34)" in them causes this error:

Your session timed out while posting. Please try to re-submit your message.
No subject was filled in.
The message body was left empty.

and won't enable you to post.

The easy workaround is to add a space, ie: "Chr (34)"

I've had this problem on the blog as well, must be a PHP thing?
Title: Re: Workaround For Problem Posting Code With "Chr (34)"
Post by: Lars-Erik on April 28, 2008, 09:07:02 AM
O that must be why it wouldn't let me post! I fixed it by inserting a screen shot of my VBA code.
I've tested it on my Wordpress install, but it seems to be no problem, Wordpress wont allow PHP in posts though (not without a plugin).

Anyway, good to know theres a workaround
Title: Re: Workaround For Problem Posting Code With "Chr (34)"
Post by: jastronomy on October 28, 2010, 10:28:31 PM
Think of this like DOS.

Strings must have quotes around them if the whole string is made of up of multiple characters/words that are separated with a space.

String = "My Value"

When programming you can include quotes in two ways:
Lets be crude and use VBS to write 2 Variables inside a HTML formatted file, using: oFile.WriteLine
The title is written without quotes, and the string is written with quotes in two different ways - both are valid.
oFile.WriteLine " <html> "
oFile.WriteLine " <head> "
oFile.WriteLine " <title>" & sTitle & "</title> "
oFile.WriteLine " </head> "
oFile.WriteLine " <body lang=EN-GB link=blue vlink=blue> "
oFile.WriteLine " Method 1: " & """ & sString & """
oFile.WriteLine " Method 2: " & chr(43) & sString & chr(34)
oFile.WriteLine " </body> "
oFile.WriteLine " </html> "


I don't know exactly about PHP; but it's effectively a HTML/on-the-fly with server side ASP/VB/Javascript processing... so they should be similar.

Hope it helps.
Title: Re: Workaround For Problem Posting Code With "Chr (34)"
Post by: william slaney on June 15, 2022, 08:16:41 AM
oFile.WriteLine " Method 2: " & chr(43) & sString & chr(34)

A problem of dyslexia, 43 should be 34
Title: Re: Workaround For Problem Posting Code With "Chr (34)"
Post by: Yacine on June 15, 2022, 10:02:53 AM
Correcting such an old post shows a certain tendency to necrophilia. ;) :D
Title: Re: Workaround For Problem Posting Code With "Chr (34)"
Post by: Visisthebest on June 15, 2022, 10:30:39 AM
Still very good to keep old posts updated, sometimes you overlook these small typos losing a lot of time debugging something so straightforward.