SyntaxError: missing (Eval)

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

SyntaxError: missing (Eval)

by Co0oDe on Sat Aug 29, 2015 11:21 am

OS: WINDOWS 10
iMacros: VERSION BUILD=8920312
Browser: Firefox 39.0
---------------------------------------
i was trying to convert imacros to javascript...
but i got that error
SyntaxError: missing ; before statement, line 1 (Error code: -991)

My Code
Code: Select all
macro +=  "SET !VAR3 EVAL("Math.floor(Math.random()*256 + 1);")" + "\n";
Co0oDe
 
Posts: 12
Joined: Tue Jul 21, 2015 9:17 am

Re: SyntaxError: missing (Eval)

by chivracq on Sun Aug 30, 2015 6:17 am

Co0oDe wrote:OS: WINDOWS 10
iMacros: VERSION BUILD=8920312
Browser: Firefox 39.0
---------------------------------------
i was trying to convert imacros to javascript...
but i got that error
SyntaxError: missing ; before statement, line 1 (Error code: -991)

My Code
Code: Select all
macro +=  "SET !VAR3 EVAL("Math.floor(Math.random()*256 + 1);")" + "\n";

Yep, I think you need to (Single, Double, Triple...?) escape the Double Quotes within the 'EVAL()'...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6473
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: SyntaxError: missing (Eval)

by Co0oDe on Sun Aug 30, 2015 8:39 am

Yep, I think you need to (Single, Double, Triple...?) escape the Double Quotes within the 'EVAL()'...

Yes you're right.
Correct Code:
Code: Select all
macro +=  "SET !VAR3 EVAL('Math.floor(Math.random()*256 + 1);')" + "\n";
Co0oDe
 
Posts: 12
Joined: Tue Jul 21, 2015 9:17 am

Re: SyntaxError: missing (Eval)

by chivracq on Sun Aug 30, 2015 8:44 am

Co0oDe wrote:
Yep, I think you need to (Single, Double, Triple...?) escape the Double Quotes within the 'EVAL()'...

Yes you're right.
Correct Code:
Code: Select all
macro +=  "SET !VAR3 EVAL('Math.floor(Math.random()*256 + 1);')" + "\n";

Oh..., good...!, or replace them with Single Quotes indeed, which I find more "elegant"...!
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6473
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 4 guests

-->