Using quote marks in a string variable

Using quote marks in a string variable

atomic.lex
Enthusiast Enthusiast
2,881 Views
5 Replies
Message 1 of 6

Using quote marks in a string variable

atomic.lex
Enthusiast
Enthusiast

Hi there,

 

How could it be possable to write some quote marks in  a string variable?

For example:    

 

Dim x As String = " some text "some text in quotes" "

 

Is it possable in ilogic???

Accepted solutions (1)
2,882 Views
5 Replies
Replies (5)
Message 2 of 6

atomic.lex
Enthusiast
Enthusiast
Accepted solution

It works with & CHR(34) &  Thanks)

 

Message 3 of 6

NachoShaw
Advisor
Advisor
You should also be able to double quote it

Dim x As String = "some text " & """ some quoted text """

I'll check though, it's possible in vba

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 4 of 6

atomic.lex
Enthusiast
Enthusiast

Yes, it´s possable in VBA, but not in iLogic code

0 Likes
Message 5 of 6

NachoShaw
Advisor
Advisor
You can do it in vb.net and VBA so why not ilogic? I thought ilogic was build on the base language but with an additional user UI

https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/how-to-put-quotation-marks-in-a-...

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 6 of 6

kwalker1
Enthusiast
Enthusiast

For those referring to this thread, please note that the code needs to be written as & Chr(34) & to work.

Hence the upper case and lower case characters are important. Don't use all upper case characters.

Took me quite a while to work out why it was not working for me until I tried this.

 

So for example the following should show the quotation marks in the string.

Dim x As String = "Some text plus " & Chr(34) & "some text in quotes" & Chr(34)
MessageBox.Show(x, "Title")