Question Quick Question Code Needed

griffithdesign

Active member
Joined
Sep 17, 2008
Messages
34
Programming Experience
Beginner
I am making a code generator and I have ran into several problems. First problem:
VB.NET:
TextBox21.Text = "new RSTile(" & TextBox1.Text & "," & TextBox20.Text "),"
That last part in the code the
VB.NET:
"),"
Part that gives me an error.

Second problem. This is going to have many of these boxes but how do I make it where the second code shows up under. For exzample:
VB.NET:
TextBox21.Text = "new RSTile(" & TextBox1.Text & "," & TextBox2.Text "),"
TextBox21.Text = "new RSTile(" & TextBox3.Text & "," & TextBox4.Text "),"
I dont want to erase the text in Textbox21 I just want the code to appear under the first code. If you dont understand what I mean I will make a picture.
 
Please do us the courtesy of posting in the most appropriate forum for the topic of the thread and not just the first one you come to. Anything to do with code is obviously not an IDE problem so it doesn't belong in a forum dedicated to the IDE. Thread moved.

I suggest that you read your code a bit more closely in future:
VB.NET:
TextBox21.Text = "new RSTile("[B][U] & [/U][/B]TextBox1.Text[B][U] & [/U][/B]","[B][U] & [/U][/B]TextBox2.Text "),"
Do you notice any inconsistency between how you're trying to join the last two substrings compared to the rest?
 
With regards to the second question, the answer is basically the same. You use & to join two strings together. That said, you might also look at the AppendText method of the TextBox.
 
72776540.jpg

As seen in the picture I want there to be a sepration between the codes. I want it do it like this:
VB.NET:
Yellow Line #1
Yellow Line #2
Yellow Line #3
 
Joining strings is the same no matter the content. If you want to insert a line break into a string then you can use ControlChars.NewLine or Environment.NewLine, both of which will return a string containing a carriage return character (ASCII 13) and a line feed character (ASCII 10).
 
VB.NET:
TextBox21.Text = "new RSTile(" & TextBox1.Text & "," & TextBox2.Text "),"

Where do I add your code. Dude im only 15 I dont understand very big things.
 
VB.NET:
TextBox21.Text = "new RSTile(" & TextBox1.Text & "," & TextBox2.Text [B][COLOR="Red"][U]&[/U] [/COLOR][/B]"),"

You could also investigate using String.Format - ie

VB.NET:
TextBox21.Text &= String.Format ("new RSTile({0},{1}){2}", TextBox1.Text, TextBox2.Text, Environment.NewLine)
 
VB.NET:
TextBox21.Text = "new RSTile(" & TextBox1.Text & "," & TextBox2.Text "),"

Where do I add your code. Dude im only 15 I dont understand very big things.
Um, I didn't provide any code. I simply quoted your code and highlighted the ampersands to indicate to you that they were something you should think about. Being 15 doesn't preclude you from reading what's posted and thinking about what it means. At least, it didn't back in my day. Of course, we did have to walk 15 miles to school in the snow with no shoes. ;)
 
Back
Top