Syntax problem on IF Statement

Use this board to ask questions or have discussions with other Atrium users.
Post Reply
gleary@amports.com
New User
Posts: 2
Joined: Fri Sep 11, 2015 10:25 am
First Name: Gordon
Last Name: Leary
Company Name: AMPORTS
Phone: 410-843-7110
Address 1: 2901 Childs St
City: Baltimore
State / Province: Maryland
Zip / Postal Code: 21226
Country: United States
Contact:

Syntax problem on IF Statement

Post by gleary@amports.com »

I am getting a red "X" stating a missing semicolon on my IF statements. This is on a ONROWCLICK. If I put the semicolon as

IF (Brand == "VW"); {CC = '55VW';}

It is happy, but does not work because of the missing condition. Been staring and trying on this one way to long. Below is the code as I expect it to work.

pui.set("S_VIN", getObj("Grid1").grid.getCellValue(row, 6));
pui.set("Brand", getObj("Grid1").grid.getCellValue(row, 0));
IF (Brand == "VW") {CC = '55VW';}
IF (Brand == "Audi") {CC = '55AU';}
IF (Brand == "Bentley") {CC = '55BM';}
VINp = get("S_VIN");
CoClVINp = CC + VINp;
Atrium.launchURL('/profoundui/auth/start?atrium_item=219&p1='+CoClVINp+'&l1=21', 'VIN Inquiry');
User avatar
Glenn
Profound Logic Staff Member
Posts: 124
Joined: Mon Apr 14, 2014 4:08 pm
First Name: Glenn
Last Name: Hopwood
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: Syntax problem on IF Statement

Post by Glenn »

JavaScript is case sensitive. Your "IF" statement needs to be "if". The JavaScript interpreter would probably see "IF ()" as a call to a function named "IF".

Glenn
gleary@amports.com
New User
Posts: 2
Joined: Fri Sep 11, 2015 10:25 am
First Name: Gordon
Last Name: Leary
Company Name: AMPORTS
Phone: 410-843-7110
Address 1: 2901 Childs St
City: Baltimore
State / Province: Maryland
Zip / Postal Code: 21226
Country: United States
Contact:

Re: Syntax problem on IF Statement

Post by gleary@amports.com »

Thank you Glenn. I was going to try that too, and got side tracked. I knew it was an easy one.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests