pat.stave Posted April 20, 2021 Report Posted April 20, 2021 (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 April 20, 2021 by pat.stave Quote
Crossbow Posted April 20, 2021 Report Posted April 20, 2021 Pretty sure the IEC method for entering strings is in single quotes... So try putting your double quote inside a pair of single quotes. Quote
pat.stave Posted April 20, 2021 Author Report Posted April 20, 2021 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. Quote
pat.stave Posted April 21, 2021 Author Report Posted April 21, 2021 2 hours ago, sczot said: hi, is it ok like this? 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! Quote
Recommended Posts
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.