How do I do what the title says?
Then, depending on those 6 new variables, I need to find 6 images on the screen and click them. Say I call the 6 variables number1,2,...6
Would it be correct to replace the image path with %BMP_DIR%/%number1,2,...6%.bmp ?
Thanks
How to split a 6-digit number into 6 variables
Moderators: Dorian (MJT support), JRL
Re: How to split a 6-digit number into 6 variables
Using RegEx takes care of the first part (gives the digits as digit_1, digit_2, ...)
Code: Select all
Let>dig0=987654
RegEx>\d,dig0,0,digit,nm,0
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
Re: How to split a 6-digit number into 6 variables
While RegEx is a very powerful tool, it is not an easy tool to learn.
I would suggest this code, while not nearly as elegant or efficient is much easier to actually read.
This just parses the numbers into the separate variables that you can use however you need.
Let>a=123456
MidStr>a,1,1,Variable1
MidStr>a,2,1,Variable2
MidStr>a,3,1,Variable3
MidStr>a,4,1,Variable4
MidStr>a,5,1,Variable5
MidStr>a,6,1,Variable6
I would suggest this code, while not nearly as elegant or efficient is much easier to actually read.
This just parses the numbers into the separate variables that you can use however you need.
Let>a=123456
MidStr>a,1,1,Variable1
MidStr>a,2,1,Variable2
MidStr>a,3,1,Variable3
MidStr>a,4,1,Variable4
MidStr>a,5,1,Variable5
MidStr>a,6,1,Variable6
Re: How to split a 6-digit number into 6 variables
Thanks you, both codes worked perfectly.