!VAR1 length

Discussions and Tech Support related to the iMacros Google Chrome extension.
Forum rules
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
les_stockton
Posts: 32
Joined: Sun Mar 06, 2011 11:30 pm

!VAR1 length

Post by les_stockton » Fri Oct 19, 2018 1:29 pm

WINDOWS 10
CHROME Versió 67.0.3396.99 (64 bits)
iMacro Version 10.0.2

I have a simple question. Shouldn't matter which OS or browser, and in fact, I'm hoping the solution is browser independent.

I want to set a variable to the length of a variable (!COL1 or !VAR1, as an example).
I'm getting errors that the syntax I am using doesn't work, although I've seen this as an example for how to do it.

Code: Select all

SET !VAR1 EVAL("{{!COL1}}.length")
any ideas on a better way?
chivracq
Posts: 8430
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: !VAR1 length

Post by chivracq » Fri Oct 19, 2018 2:03 pm

les_stockton wrote:

Code: Select all

WINDOWS 10
CHROME Versió 67.0.3396.99 (64 bits)
iMacro Version 10.0.2
I have a simple question. Shouldn't matter which OS or browser, and in fact, I'm hoping the solution is browser independent.

I want to set a variable to the length of a variable (!COL1 or !VAR1, as an example).
I'm getting errors that the syntax I am using doesn't work, although I've seen this as an example for how to do it.

Code: Select all

SET !VAR1 EVAL("{{!COL1}}.length")
any ideas on a better way?
Current Version for CR is actually v10.0.5 btw... :wink:

But yep, I use that Functionality myself in several of my own Scripts, using some slightly different Syntax...:

Code: Select all

SET !VAR1 EVAL("var c1='{{!COL1}}'; var z=c1.length; z;")
PROMPT COL1:<SP>_{{!COL1}}_<BR>Length:<SP>{{!VAR1}}
(Not tested...)
- (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...
les_stockton
Posts: 32
Joined: Sun Mar 06, 2011 11:30 pm

Re: !VAR1 length

Post by les_stockton » Fri Oct 19, 2018 7:06 pm

I think your syntax is better. thanx
chivracq
Posts: 8430
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: !VAR1 length

Post by chivracq » Fri Oct 19, 2018 9:25 pm

les_stockton wrote:I think your syntax is better. thanx
"My" Syntax is "always" better..., ah-ah...!, or at least works...!, I've tested it, I use it myself... (Meant a bit as a "Joke", but I guess I'm still a bit "right"... :wink: )

Glad I could help btw...! :D
- (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...
Post Reply