Jump to content

Recommended Posts

Posted (edited)

How can i write a string constant to represent the character " (american quotation mark, ASCII code 34dec).

I've tried the following:

  • '"' (single quotation mark, american quotation mark, single quotation mark)
  • '$"' (single quotation mark, escape character, american quotation mark)
  • """ (american quotation mark, american quotation mark, american quotation mark)
  • "$"" (american quotation mark, escape character, american quotation mark, american quotation mark)

None of these are seen as valid by GX Works 2. How do i represent an american quotation mark as a string constant?

Edited by pat.stave
Posted
9 minutes ago, Crossbow said:

Pretty sure the IEC method for entering strings is in single quotes... So try putting your double quote inside a pair of single quotes.

Nope, doesn't work.

Posted
2 hours ago, sczot said:

hi,

is it ok like this?

code.png

Thanks. Ended up doing it in this manner. Not very elegant as i use the character many places (including inside functions that cannot access global labels). But - it works!

 

 

temp.PNG

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...