View unanswered posts | View active topics
It is currently Fri Jul 18, 2025 3:40 pm
Author |
Message |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
Not really the place 
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Mon Jun 07, 2010 1:20 am |
|
 |
james016
Doesn't have much of a life
Joined: Tue May 05, 2009 5:52 pm Posts: 1899
|
How would I use that in the code? Pasting it after Version Number gives errors so I am missing something. What I have at the moment is this: Many thanks.
_________________ My Flickr PageNow with added ball and chain.
|
Mon Jun 07, 2010 8:31 am |
|
 |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5158 Location: /dev/tty0
|
|
Mon Jun 07, 2010 9:54 am |
|
 |
james016
Doesn't have much of a life
Joined: Tue May 05, 2009 5:52 pm Posts: 1899
|
Thank you Ben That worked 
_________________ My Flickr PageNow with added ball and chain.
|
Mon Jun 07, 2010 10:23 am |
|
 |
forquare1
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 6:36 pm Posts: 5158 Location: /dev/tty0
|
No problem, I've not done C# before, but after having a look, this is slightly more correct: Strings in both Java and C# are immutable (i.e. they can't be changed). In the snippet I have you before, the code had to take two Strings and stick them together to create a third String. This is generally bad practise as you're using twice as much memory. The StringBuilder I've used above has the same effect, but enlarges the amount of memory it uses to accommodate the new text. EDIT: Sorry James, accidentally posted an opening square bracket at the end there. Also, you may need to include System.Text.StringBuilderI can't test it as I don't have a C# editor/compiler here...
Last edited by forquare1 on Mon Jun 07, 2010 2:58 pm, edited 1 time in total.
|
Mon Jun 07, 2010 10:44 am |
|
 |
james016
Doesn't have much of a life
Joined: Tue May 05, 2009 5:52 pm Posts: 1899
|
Unless I am missing something, copying and pasting that code gave me some errors. On the plus side I managed to make a .msi file for installation. 
_________________ My Flickr PageNow with added ball and chain.
|
Mon Jun 07, 2010 1:09 pm |
|
 |
EddArmitage
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 9:40 pm Posts: 5288 Location: ln -s /London ~
|
I would guess you've copied the opening square bracket after the closing curly brace? Do you understand what the code is doing/how it works, and how/why using a stringbuilder is better than combining two strings?
|
Mon Jun 07, 2010 2:07 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
Simpler way I would suggest is: might need to change String to string but that simplifies it instead or \r\n it's better practice to use Environment.Newline, different systems interpret the new line differently and can cause formatting issues, Environment.Newline is a target dependent variable
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Mon Jun 07, 2010 5:21 pm |
|
 |
james016
Doesn't have much of a life
Joined: Tue May 05, 2009 5:52 pm Posts: 1899
|
Thank you for the tips. I will look at these tomorrow at work.
_________________ My Flickr PageNow with added ball and chain.
|
Mon Jun 07, 2010 7:02 pm |
|
|
Who is online |
Users browsing this forum: No registered users and 6 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|
|