Technical support and scripting issues
Moderators: JRL, Dorian (MJT support)
-
sailor dude
- Pro Scripter
- Posts: 50
- Joined: Fri Jan 20, 2006 10:43 pm
Post
by sailor dude » Wed Dec 13, 2006 11:00 pm
I getting a syntax error with the following code snipet and I have tried numerous permutations of syntax changes. I am stuck. Any thoughts.
Code: Select all
Ask>IS THIS A RAQ?,RAQ
If>RAQ=YES
Ask>CAN A PRICE BE GIVEN?,PRICE
EndIf>
If>RAQ=NO
Ask>WAS A QUOTE SENT?,QUOTE_SENT
EndIf>
If>{(%RAQ% = "NO") AND (%QUOTE_SENT% = "NO")}
Press Enter
Wait>0.5
Press Enter
ENDIF
If>QUOTE_SENT = YES
Send>You should have received your quote for the %MODEL% by email.
Press ENTER
Press ENTER
ENDIF
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Wed Dec 13, 2006 11:10 pm
Line 13 should be:
If>{((%RAQ% = "NO") AND (%QUOTE_SENT% = "NO"))}
I.e. you need extra parentheses around the entire expression.
-
sailor dude
- Pro Scripter
- Posts: 50
- Joined: Fri Jan 20, 2006 10:43 pm
Post
by sailor dude » Thu Dec 14, 2006 3:16 pm
I tried it and I still get syntax error, error parsing expression
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Thu Dec 14, 2006 4:05 pm
If RAQ is YES QUOTE_SENT is never created. So you will get an error in line 14.
This works:
Code: Select all
Ask>IS THIS A RAQ?,RAQ
If>RAQ=YES
Ask>CAN A PRICE BE GIVEN?,PRICE
EndIf>
If>RAQ=NO
Ask>WAS A QUOTE SENT?,QUOTE_SENT
Else
Let>QUOTE_SENT=NIL
EndIf
If>{(%RAQ% = "NO") AND (%QUOTE_SENT% = "NO")}
Press Enter
Wait>0.5
Press Enter
ENDIF
If>QUOTE_SENT = YES
Send>You should have received your quote for the %MODEL% by email.
Press ENTER
Press ENTER
ENDIF
-
sailor dude
- Pro Scripter
- Posts: 50
- Joined: Fri Jan 20, 2006 10:43 pm
Post
by sailor dude » Thu Dec 14, 2006 7:03 pm
I added
Let>RAQ=NIL
Let>PRICE=NIL
Let>QUOTE_SENT=NIL
at the beginning of the script.
I still get syntax errors.
Attached is part of the log file for the case of No then Yes at the ASK commands
12/14/2006 12:01:27:194 - START: If>{((NO = "NO") AND (YES = "NO"))}
12/14/2006 12:01:27:194 - END: ENDIF
12/14/2006 12:01:27:210 - START:
12/14/2006 12:01:27:210 - END:
12/14/2006 12:01:27:210 - START:
12/14/2006 12:01:27:210 - END:
12/14/2006 12:01:27:210 - START: If>QUOTE_SENT = YES
12/14/2006 12:01:27:210 - END: ENDIF
12/14/2006 12:01:27:210 - START:
12/14/2006 12:01:27:210 - END:
12/14/2006 12:01:27:225 - START:
12/14/2006 12:01:27:225 - END:
12/14/2006 12:01:27:225 - START:
12/14/2006 12:01:27:225 - END:
12/14/2006 12:01:27:225 - START:
12/14/2006 12:01:27:225 - END:
12/14/2006 12:01:27:225 - START: If>{((NO = "YES") AND (NIL = "YES"))}
12/14/2006 12:01:27:241 - END: ENDIF
12/14/2006 12:01:27:241 - START:
12/14/2006 12:01:27:241 - END:
12/14/2006 12:01:27:241 - START: If>{((NO = YES) AND (NIL = NO))}
12/14/2006 12:01:32:007 - END: ENDIF
12/14/2006 12:01:32:038 - Finished Macro : Create Customer Email2
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Thu Dec 14, 2006 7:13 pm
Just noticed there were some erroneous spaces on line 25. This works fine for me for all possible inputs:
Code: Select all
Ask>IS THIS A RAQ?,RAQ
If>RAQ=YES
Ask>CAN A PRICE BE GIVEN?,PRICE
EndIf>
If>RAQ=NO
Ask>WAS A QUOTE SENT?,QUOTE_SENT
Else
Let>QUOTE_SENT=NIL
EndIf
If>{(%RAQ% = "NO") AND (%QUOTE_SENT% = "NO")}
Press Enter
Wait>0.5
Press Enter
ENDIF
If>QUOTE_SENT=YES
Send>You should have received your quote for the %MODEL% by email.
Press ENTER
Press ENTER
ENDIF
Works ok for me. Which version of Macro Scheduler do you have?
-
Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
-
Contact:
Post
by Bob Hansen » Thu Dec 14, 2006 8:35 pm
Remove spaces in Quote_Sent line.
From:
If>QUOTE_SENT = YES
To:
If>QUOTE_SENT=YES
------------------------------------
Edited: Oops, looks like Marcus already told you about that. My reply was in limbo, and I missed his response.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
-
sailor dude
- Pro Scripter
- Posts: 50
- Joined: Fri Jan 20, 2006 10:43 pm
Post
by sailor dude » Thu Dec 14, 2006 9:10 pm
Is this the line you are talking about
IF>QUOTE_SENT=YES
There are no extraneous spaces in my code. The editor would have flagged it.
I am running ver 8.1 under WinXP SP2
It still will not run for me.
-
sailor dude
- Pro Scripter
- Posts: 50
- Joined: Fri Jan 20, 2006 10:43 pm
Post
by sailor dude » Thu Dec 14, 2006 9:24 pm
I had 2 instances of this line.
I am making progress but, still have syntax errors.
-
Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Thu Dec 14, 2006 10:05 pm
sailor dude wrote:Is this the line you are talking about
IF>QUOTE_SENT=YES
It still will not run for me.
You originally had:
If>QUOTE_SENT = YES
The code I posted works fine. No problems at all. Copy the code I posted above to a new macro and run it.
-
Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
-
Contact:
Post
by Bob Hansen » Thu Dec 14, 2006 10:10 pm
The script provided by Marcus on Thu Dec 14, 2006 2:13 pm works fine on my system.
What problems are you still having?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
-
sailor dude
- Pro Scripter
- Posts: 50
- Joined: Fri Jan 20, 2006 10:43 pm
Post
by sailor dude » Thu Dec 14, 2006 11:01 pm
Further down in my script, I missed some quotes in places where they were needed and had quotes in another places where they should not have been.
Thanks so much for your help
