bcrider wrote: ↑Wed Apr 21, 2021 9:30 pm
VERSION BUILD=12.6.505.4525
Windows 10 Pro - English
Internet Explorer Version 1909 (OS Build 18363.1316)
I am trying to use a formula looking at a spreadsheet to determine if it needs to run through these items or skip them, I know that the formula is working as I forced it to POST the results to ensure it is working properly and it is, but when I go to have it use these results in the script it generates an error because the POS=0 if I don't need it to run this part of the script...
Code: Select all
'Determine if Device with MAC ID is filled in
SET !VAR1 EVAL("var s='{{!COL11}}'.length; if(s > 0) 1; else 0;")
'Assign the device
TAG POS={{!VAR1}} TYPE=INPUT:RADIO ATTR=NAME:deviceChoice
TAG POS={{!VAR1}} TYPE=SELECT ATTR=NAME:deviceName CONTENT=%"New Device"
Error Log has this: 4/21/2021 4:19:17 PM PID:20404 Error -1300: Macro: Add New Users.iim, line 87. (-1300) Expected POS=<number> or POS=R<number> where <number> is a non-zero integer
How do I have it "skip" a section if it isn't needed according to the spreadsheet?
Yep-yep, you understood the Principle/Technique correctly, and yep indeed, "TAG POS=0" is "by (
my...!) Design" meant to do nothing because "POS=0" is not a valid Value for the 'POS' Param, but for iMacros to "accept" such a Statement, you need to activate '!ERRORIGNORE' of course...
+ Hum, I'm not sure the Syntax you are using in your 'EVAL()' Statement for your if/else Statement will work, I'm afraid it probably returns some "_undefined_" anyway, ah-ah...!
OK, you can test yourself..., I include the Syntax I use and recommend myself...:
(And that's the Syntax I already used in your
previous Thread, the Technique about "POS=0" is mine, I don't know where you got/found the Syntax that you used for your 'EVAL()' Statement, but it was definitely not from one of my Posts/Scripts...)
Code: Select all
'Determine if Device with MAC ID is filled in
SET !ERRORIGNORE YES
SET !VAR1 EVAL("var s='{{!COL11}}'.length; if(s > 0) 1; else 0;")
SET !VAR2 EVAL("var c11='{{!COL11}}', x,y,z; x=c11.length; if(x>0){z=1;} else{z=0;}; z;")
PROMPT VAR1:<SP>_{{!VAR1}}_<BR>VAR2:<SP>_{{!VAR2}}_
PAUSE
'>
'Assign the device
TAG POS={{!VAR1}} TYPE=INPUT:RADIO ATTR=NAME:deviceChoice
TAG POS={{!VAR1}} TYPE=SELECT ATTR=NAME:deviceName CONTENT=%"New Device"
... And you'll be able to check in the 'PROMPT' if both '!VAR1' and '!VAR2' return the same Result...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...