Re: Does VBscript support " & _" for long strings?



Good thought, but in this case I just have one _really, really_ long string
of items to Set right at the beginning of the code. Then as I pick up text
into another string, I do an InStr to see if my text is in the collection.

Ed

"mayayana" <mayaXXyana1a@xxxxxxxxxxxxxxxx> wrote in message
news:DRrrh.15588$X72.303@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Another thought:

This is just a matter of taste, but personally
I think it's cleaner, safer and easier to read
if it's done as a multiple concatenation:

s = "abc" & vbcrlf
s = s & "def" & vbcrlf
s = s & "ghi"
etc...

Ah! Thank you - my Copy and Paste may have done me in, then. I will
look
for that.
Ed

"Alexander Mueller" <millerax@xxxxxxxxxxx> wrote in message
news:u2Ric8jOHHA.2312@xxxxxxxxxxxxxxxxxxxxxxx
Ed schrieb:

"Michael Harris (MVP)" <mikhar.at.mvps.dot.org> wrote in message
news:%23ssqL4cOHHA.140@xxxxxxxxxxxxxxxxxxxxxxx
Ed wrote:
I know in Word and Excel VBA macros, I can set a long string using
& vbCrLf & _
to continue the string on the next line. I seem to be getting an
error in a script using this. Then again, it may well be something
else. So I thought I'd check on this while I look over everything
else just to make sure this is okay in scripting.

Thanks.
Ed
Yes - _ as a line continuation character is supported in VBScript.


Thanks, Michael. At least now I know to look elsewhere for my
problems..
8>0

Not that a trailing ' _' is legal in vb(a) but not in vbs.

msgbox "hello" _


MfG,
Alex






.



Relevant Pages

  • Re: preg_match to detect - doesnt work
    ... in a normal text input you cannot enter these characters (in a textarea you ... And then check wether this string passes or not. ... Okay, thanks. ... I am tracking the usage of my script closely and I can see that they are not even trying to use it as an open emailer. ...
    (comp.lang.php)
  • Re: How to rewrite with awk?
    ... > I'm unfamiliar with tools such as sed & awk. ... Extract the string that matches a RE. ... This script will not only expand all the lines that say "include ... file) and not resetting ARGV(the tmp file), it then lets awk do any ...
    (comp.unix.shell)
  • Re: Slow string
    ... I see virtually no difference in execution time for the code you posted when using cscript versus using wscript; to confirm, I bracketed the code with an initial ... Are you actually entering the script name into a console window? ... You can use the exact same line for every wrapper script - and that includes wsf and js scripts; all you need to do is change the final "vbs" to "wsf" or "js" as appropriate. ... If you build a large string by small concatenations, the performance degrades geometrically - so does array resizing, because they both use the same nasty technique inherited from VB1 of copying the entire data structure to a new structure with the added element. ...
    (microsoft.public.scripting.vbscript)
  • Re: Function that returns date of file.
    ... string after the date/time when it is used by itself. ... Is that your entire script? ... I make an IF statement that required the 'equals equals'. ... designed database your job will be all that much harder. ...
    (alt.php)
  • Re: Script: Remote shutdown of all domain computers
    ... When trying to run the script from a XP workstation, where i am logged in as ... Dim strBase, strFilter, strAttributes, strQuery, objRecordSet ... 2000 or above and allow shutdown, ... Public Function AllComputersAs String() ...
    (microsoft.public.windows.server.scripting)