Multi Dimensional Array

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
chowie
Newbie
Posts: 5
Joined: Thu Jun 22, 2006 7:20 am
Location: Melbourne Australia

Multi Dimensional Array

Post by chowie » Thu Jun 22, 2006 7:31 am

My apologies if this has already been asked. I have had a look through and can't find a similar question.
Is it possible to create a Multi Dimensional Array.
What I'm wanting to do is read data in from a spreadsheet and store it in a two dimensional array. I'm already using a single dimension array without problems.

I have another question regarding the recognition of web buttons. We can't get it to recognise any buttons (I can get it to recognise buttons in calculator with out any problems) I have even had Web developers trying to work this one out without success, we have tried the button name as displayed (we didn't expect that one to work) and the name that the code uses to recognise the button.

Any help will be appreciated

Thanks

Craig

chowie
Newbie
Posts: 5
Joined: Thu Jun 22, 2006 7:20 am
Location: Melbourne Australia

Post by chowie » Thu Jun 22, 2006 7:42 am

Sorry I answered my own question the problem was the debug was dumping the array variable on completion of the run.
For others interested
Let>i=1
Repeat>i
let>j=1
Repeat>j
Let>mdar[%i%,%j%]= %j%
Let>j=j+1
Until>j=5
let>i=i+1
Until>i=10
The second part to my question still remains though.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Jun 23, 2006 3:45 am

Hi Marcus,

Firstly, congratulations on the new addition to the family. 48 hours in labour? :shock: I guess there are some things even Macro Scheduler can't automate. :wink:

I have some feedback on the debugger. Appologies if these points have already been raised. I'm not sure at all if these are problems or just the way things are designed but I thought I'd mention it.

I entered the code above in an edit window, checked "Show Watch List", ran the macro and... the watch list is indeed empty. It would be nice if the values were visible after the macro finished executing. Is this possible?

Also, with running the macro this way, the cursor just stays on the first line in the editor after the macro finishes executing. It would be nice if the cursor jumped to the end to visually indicate that execution is done.

If these changes go against default behavior, perhaps it could behave this way only when "Show Watch List" is checked... as if the user has checked it, they obviously want to see the variable values.

I was able to see the values if I used Step F8. Another way was to insert a breakpoint after the last line in the script. That way, you can just run the script and see what the variables are after all lines have run but I don't think a user should have to do that extra manual step.

Also, if using F8 to single step through the program, there is a certain point at which the final variable results are available in the Watch list, they end up being:
  • J=5
    I=10
    and all values in the multi dimensional array are set
However, if you hit F8 too many times, it seems to "keep going" or "start again" only this time, it begins to do some interesting substitutions and you end up with this in the Watch List:
  • MDAR[I+1%,1]= 1 ......how did I+1% get in there?
    MDAR[I+1%,1]= 2
    MDAR[I+1%,1]= 3
    MDAR[I+1%,1]= 4
    I=i+1 .......................... how did I get to equal this?
    MDAR[%I%,4]= 4
    MDAR[%I%,3]= 3
    MDAR[%I%,2]= 2
    MDAR[%I%,1]= 1 ........ how did %I% get in there?
    J=4
I understand the whole variable resolving thing, as you once said...
"everything is seen as a variable unless you turn VAR_EXPLICIT on. It keeps resolving."
however this looks like a failure of variable resolving and could look pretty confusing to a user if they held down the F8 key a bit too long.

For this reason, it would be great if just holding the F8 key down would step through to the end of the script and stop there without starting again. The final values of the variables should be visible and if the user wanted to do more stepping, they would have to click "Stop Debug" which could clear the variables to prepare for the next run.

Just my feedback. As I said Marcus, no rush, enjoy the family and I'm sure the debugger stuff will get sorted in due time. Anyone else out there have any opinions on this? Don't be shy, let's hear from you.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Jun 23, 2006 2:26 pm

and now back to the topic... :)

chowie,

Have you tried extracting the tags from the web app with WebRecorder (another MacroSched tool)...?

With Web pages the usual MacroScript command will not recognise buttons, and other "Windows" objects like edit boxes, etc....

download WebRecorder, you and/or your web dev guys can take a swing at it. WebRecorder creates MacroScript code just as you are already working with.

chowie
Newbie
Posts: 5
Joined: Thu Jun 22, 2006 7:20 am
Location: Melbourne Australia

Post by chowie » Tue Jun 27, 2006 7:47 am

Yes. I even got one of the web developers to write a simple page. One of the other guys who was a developer until a few months ago has been heavilly involved.

chowie
Newbie
Posts: 5
Joined: Thu Jun 22, 2006 7:20 am
Location: Melbourne Australia

Post by chowie » Tue Jun 27, 2006 7:49 am

No one has had any real success. I have had success with the graphic recognition part, but I'm mainly using x,y co-ordinates, which I don't like doing.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts