Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Split 1

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I have a script I am trying to translate from asp/vbscript to asp/jscript so I will have a lot of questions today :)

My first is:

Split(objDictStream.Read(intDictSize), vbNewLine)

What is vbNewLine doing here?

[conehead]
 
breaking the string at the new line character...

i mean VbNewLine is the new line character...

-DNG
 
That should be vbNewLine (lowercase first letter), although I don't think that VBScript cares.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Tracy,

vbscript is not case sensitive although javascript is...

-DNG
 
I know, that's why I said "I don't think VBScript cares". However its always a good idea to do it right, and that goes especially for using the correct case. If you don't get in the habit, and you switch back and forth between VBSript and JavaScript like most of us do, you'll get bitten by it, and case sensitivity issues can be very hard to spot and debug in JS, especially if you're not looking for them.

Additionally, if you tried using VbNewLine in a regular VB program (I write those too), you'll get an error. VB is case sensitive.

You can never go wrong by ALWAYS using the correct case.

Let's try to get the new programmers on the board into the habit of doing it right, right from the start, instead of teaching them our bad habits.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
I totally agree with you Tracy...and i will keep that in mind...thanks

-DNG
 
vbnewline is a vb constant, js knows nothing about it.
 
thats right tsuji,

TheConeHead was just asking what it meant in vbscript...i think he is trying to understand the vbscript functions first so that he can then translate it to jscript...

-DNG


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top