Computing Vars using 'EVAL()' (Addition)

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Sajjad98
Posts: 2
Joined: Sun Sep 18, 2022 6:33 am

Computing Vars using 'EVAL()' (Addition)

Post by Sajjad98 » Sun Sep 18, 2022 6:45 am

Code: Select all

Version Build=10101485
Windows 10 English
Firefox 104
Hi can someone help me fix this simple code
The value of the first variable is 166
The value of the second variable is initially zero, which is added to the number 1 every time it is executed (i=i+1 in vb)
The value of the third variable is the sum of the other two variables
thnks

Code: Select all

VERSION BUILD=10101485
SET !VAR0 = 166
ADD !VAR1 +1
SET VAR3 EVAL({{VAR0}}+{{VAR1}})
TAG POS={{!VAR3}} TYPE=BUTTON ATTR=NAME:follow
Last edited by chivracq on Sun Sep 18, 2022 11:29 pm, edited 1 time in total.
Reason: Thread Title made a bit Descriptive (was a useless "Help please fix this simple Code"...).
techimac
Posts: 482
Joined: Fri Feb 20, 2015 9:27 pm

Re: Computing Vars using 'EVAL()' (Addition)

Post by techimac » Sun Sep 18, 2022 12:51 pm

Code: Select all

SET !VAR1 166
SET !VAR2 1
SET !VAR3 EVAL("Number('{{!VAR1}}') + Number('{{!VAR2}}');")

prompt {{!VAR3}}

TAG POS={{!VAR3}} TYPE=BUTTON ATTR=NAME:follow
Available for custom iim, javascript iMacros scripts
Sajjad98
Posts: 2
Joined: Sun Sep 18, 2022 6:33 am

Re: Computing Vars using 'EVAL()' (Addition)

Post by Sajjad98 » Mon Sep 19, 2022 9:21 am

techimac wrote:
Sun Sep 18, 2022 12:51 pm

Code: Select all

SET !VAR1 166
SET !VAR2 1
SET !VAR3 EVAL("Number('{{!VAR1}}') + Number('{{!VAR2}}');")

prompt {{!VAR3}}

TAG POS={{!VAR3}} TYPE=BUTTON ATTR=NAME:follow
thanks for reply m8
but there are error
Value of !VAR3 is always 167 And it is not added to its amount on every run
i need to Value of !VAR3 be 167 , 168 , 169 ..... (Add up with the number 1 each time)

the code i write is

Code: Select all

VERSION BUILD=10101485
SET !VAR1 166
SET !VAR2 1
SET !VAR3 EVAL("Number('{{!VAR2}}') + Number('1');")
SET !VAR4 EVAL("Number('{{!VAR3}}') + Number('{{!VAR1}}');")
prompt {{!VAR4}}
but it's says !VAR4 is Unsupported ,seems there to be a limitation in the use of variables
techimac
Posts: 482
Joined: Fri Feb 20, 2015 9:27 pm

Re: Computing Vars using 'EVAL()' (Addition)

Post by techimac » Mon Sep 19, 2022 9:38 am

Code: Select all

SET !VAR1 166

SET !VAR3 EVAL("Number('{{!VAR1}}') + Number('{{!loop}}');")

prompt {{!VAR3}}

TAG POS={{!VAR3}} TYPE=BUTTON ATTR=NAME:follow
Available for custom iim, javascript iMacros scripts
Post Reply