IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesJavaScript  Print This     

End of Statement (JavaScript and Delphi Prism Cross Reference Guide)

By Mike Prestwood

JavaScript versus Delphi Prism: A side by side comparison between JavaScript and Delphi Prism.

 
Language Basics
 

Language basics is kind of a catch all for absolute beginner stuff. The items (common names) I chose for language basics is a bit random and include items like case sensitivity, commenting, declaring variables, etc.

End of Statement

[Other Languages] 

Languages Focus

In coding languages, common End of statement specifiers include a semicolon and return (others exist too). Also of concern when studying a language is can you put two statements on a single code line and can you break a single statement into two or more code lines.

JavaScript:   ; is optional

In JavaScript, using a semicolon at the end of statements is optional. You might think a semicolon then is just another comment specifier but it is not. The semicolon is an optional end of statement specifier. To put two statements on a single code line, you must use a semicolon. However, the semicolon is optional, but probably confusing, when you break a single statement into multiple code lines.

Syntax Example:
document.write("Hello1");
document.write("Hello2");

//Semicolons are optional:
document.write("Hello3")
document.write("Hello4")

//This works too but only if you use a semicolon:
document.write("Hello5"); document.write("Hello6");

//Two lines also works:
document.write
("Hello7")
Delphi Prism:   ;

Object Pascal uses a semicolon ";" as an end of statement specifier and you can put multiple statements on a single line of code and put a single statement on two or more code lines if you wish.

Syntax Example:  
MessageBox.Show("Hello1");
MessageBox.Show("Hello2");
MessageBox.Show("Hello3");

//Same line works too:
MessageBox.Show("Hello4");  MessageBox.Show("Hello5");

//Two or more lines works too:
MessageBox.Show
("Hello6");












Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]