
Room Activation - EduGeek.net Wiki
Is there anyway to fix this problem apart from manually putting a line in?
Thanks

I think this is more a case of coding etiquette. I was taught that you should always try to limit each line to 80 characters, entering long lines across multiple lines.

I agree with localzuk in this instance, you can use continuation characters to break up the lines to make it more easily readable in print or screen format and yet continue code execution as if it was a single line. I think the VBS one is:
Code:_ Example: MsgBox "This is the firs tline" & _ "this is the second"
I'd guess 80 characters is a throwback to punched cards or text mode screens which were 80 characters wide but short lines are easier to read (think newspaper columns).
I often do things like:
sMsg="this is the first bit of the message"
sMsg=sMsg & " and this is the next bit"
msgbox sMsg
which I find easier to read. It's also good when you're building SQL queries - I like to have the select, from, join, order etc bits on separate lines.

If you are appending lots of different strings together with "string" & "string" it becomes quite slow (comparatively) due to the way that VBS handles string concatenation. The best and fastest way is to use a stringbuilder class to join all of these strings together.
For these types of scripts the performance hit is not really important but the more text that you add the more of a problem it can become for the run time.
Here is a better write up on it and an example:
15 Seconds : Code Samples : Super Fast String Concatenation

There are currently 1 users browsing this thread. (0 members and 1 guests)