|
-
Jun 4th, 2009, 05:28 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Insert this chacter in a string: &
Hi
how I can insert this character in a string: &
I tried this:
example:
"Manolitos " & "&" & " Co."
but it displays error end instruction was waited
Regards
-
Jun 4th, 2009, 05:35 AM
#2
Re: Insert this chacter in a string: &
Hmm - I don't get the error, but also why not just have it entirely enclosed in quotes.
Can you show us your code.
-
Jun 4th, 2009, 05:36 AM
#3
Re: Insert this chacter in a string: &
How about
Code:
Label1.Text = "Manolitos " & "&&" & " Co."
-
Jun 4th, 2009, 05:54 AM
#4
Addicted Member
Re: Insert this chacter in a string: &
 Originally Posted by Hack
How about
Code:
Label1.Text = "Manolitos " & "&&" & " Co."
Yeah that's what i was thinking might be the problem, but it shouldn't cause an error if you only have 1.
Why not enclose the entire string in quotes?
-
Jun 4th, 2009, 05:56 AM
#5
Thread Starter
Hyperactive Member
Re: Insert this chacter in a string: &
the text to insert a in a string is this:
CType(sender, XRLabel).Text = "Page " & PageNumber.ToString() & " of " & PageCount.ToString()
(I need to replace .vb file and I need insert a new line code)
regards
-
Jun 4th, 2009, 05:56 AM
#6
Re: Insert this chacter in a string: &
 Originally Posted by Hack
How about
Code:
Label1.Text = "Manolitos " & "&&" & " Co."
I must be missing something, because this works perfectly well :
Code:
Label1.Text = "Manolitos & Co."
Of course you need to set the UseMnemonic property to false in order to show the apersand in a control like a label, but even without doing that there is no error.
-
Jun 4th, 2009, 05:58 AM
#7
Re: Insert this chacter in a string: &
 Originally Posted by anna7
the text to insert a in a string is this:
(I need to replace .vb file and I need insert a new line code)
regards
I don't see anywhere in that example where you would be putting an "&" within the string.
-
Jun 4th, 2009, 06:06 AM
#8
Thread Starter
Hyperactive Member
Re: Insert this chacter in a string: &
I need to insert this text (exact) in a string:
myString="CType(sender, XRLabel).Text = "Page " & "&" & "PageNumber.ToString()" &" &" & " of " & " & " & "PageCount.ToString() "
Output will be this:
CType(sender, XRLabel).Text = "Page " & PageNumber.ToString() & " of " & PageCount.ToString()
-
Jun 4th, 2009, 06:19 AM
#9
Thread Starter
Hyperactive Member
Re: Insert this chacter in a string: &
finally I've solved this issue:
myString = "CType(sender, XRLabel).Text = ""Página "" & PageNumber.ToString() & "" de "" & PageCount.ToString()"
and output:
CType(sender, XRLabel).Text = "Page " & PageNumber.ToString() & " of " & PageCount.ToString()
-
Jun 4th, 2009, 06:21 AM
#10
Re: [RESOLVED] Insert this chacter in a string: &
OK your problem isn't with the "&" it's with the quotes. VB will treat the "Page" as a keyword as it isn't inside the quotes.
EDIT - sorry, too slow in my typing !
That just illustrates why its a good idea to show your code at the start!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|