This is asp and javascript - not Java. Perhaps you would get more help over in those forums, as this one is for Java programming. At a glance though, those extremely long nested switch statements make me cringe.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
JavaScript != Java
You have shown only JavaScript. There is no Java anywhere in that post.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Shows my level of newbness on java, I am a vbscipt/asp guy trying to learn some java for client side.
I am open to any code to accomplish what I need.
You should post this question and code in the Web Development / Javascript forum. As has been pionted out, this forum is for Java questions, which is not the same thing as Javascript.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
The code I saw is not valid javascript.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
Java and JavaScript are two totally different languages. The only common element is the name "Java".
You can't learn JavaScript from a Java book, or Java from a JavaScript book.
The following is NOT valid JavaScript, though it is valid Java.
code = Trim(DataRangeHdr1("code"))
DiagnosisName = DataRangeHdr1("DiagnosisName")
DiagnosisName = (Replace(DiagnosisName,"'"," "))
CodeMark = InStr(code,".")
JavaScript requires a semicolon at the end of each statement, except in certain positions (where the semicolon must not appear). Java does not require semicolons except in certain constructions.
Internet Explorer allows some JavaScript statements to work correctly without semicolons, but other browsers do not. So IE cheats. Don't write your code to rely on IE quirks.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
What are you smoking kid?
In Java every statement (unless it is a compound statement) needs to be terminated with a semicolon (compound statements need not be, as they're demarkated by braces which act as terminators).
Your "Java" example looks more like Visual Basic to me.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Then this book I have is trash.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
I did some more investigation, and found out that the only book I have on Java (as opposed to JavaScript) was worth what I paid for it: It was given to me as "surplus materials" at the library fundraiser auction two years ago. Now I know why they got rid of it.
Now that I look at it closer, it seems to be a book on programming tricks using the quirks of one particular interpreter. It's in "cookbook" form. I thought it was a reference book, since the library's reference department had it, and stamped REFERENCE all over it. (Maybe I should have read the preface.)
I am writing an appropriate word across the front cover:
"Void"
It reminds me of an economics book I used to have, which purported to be an econ textbook, but which actually distorted economic theory to advocate socialism.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
Glad you got rid of that book. The content it had was kind of giving us fits... ;-)
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
Internet Explorer allows some JavaScript statements to work correctly without semicolons, but other browsers do not. So IE cheats. Don't write your code to rely on IE quirks.
IE is correct; according to the 'standard' semicolons after javascript statements are optional. Or, as I just read; 'automatically inserted by the parser when it encounters newlines'. Read the ECMAScript standard document if you like.. javascript is approximately equal to ( and syntatically identical to ) ECMAscript. I'm not sure which ecmascript version corresponds to which JS version, but the semicolon thing has been around since before I saw any javascript. If other browsers aren't allowing this, they're not using conformant ECMAscript parsers. http://www.ecma-international.org/publications/standards/Ecma-262.htm
it's a word doc, do a search in it for 'automatic semicolon insertion'. saying that though; I'd personally recommend a real semicolon after every statement. ( in javascript and english. )
perhaps you're getting confused about java / javascript yourself there MidiMagic :P ... but, the OP did insist on repeatadly 'saying' java even after correction... the original code is html + javascript + asp with vbscript, without a hint of java. and it's way too long for me to read more than half of it.
who had the java.* name first?
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64