Viewing array for testing

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bqsbarbqGAnC5Z
Posts: 77
Joined: Thu Dec 08, 2011 12:19 pm

Viewing array for testing

Post by bqsbarbqGAnC5Z » Fri May 11, 2012 8:24 am

Hi everyone,

I was wondering if there was any way for me to view an array while my application is running. I've been running into a problem with my array and I want to see what is actually happening in there while I test it. Is there any way for me to do this? Thanks for your help!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Viewing array for testing

Post by Mark » Fri May 11, 2012 10:57 am

Hi,

When the debugger is active, you can view your array in the variables tab at the bottom of the script editor.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Viewing array for testing

Post by dunbarx » Fri May 11, 2012 4:03 pm

HI.

As Mark says, the debugger shows the keys and elements of an array directly, but only when a script is being examined. This is very convenient.

But you said "while running". In this case you will need to view the array, perhaps in a field or dataGrid, on the fly.

So in your running handler, in the right place(s):

combine yourArray by return and tab
put yourArray into fld "viewArray"

The array will appear every time the code snippet is executed, which could be each pass through a loop, or wherever.

Craig Newman

bqsbarbqGAnC5Z
Posts: 77
Joined: Thu Dec 08, 2011 12:19 pm

Re: Viewing array for testing

Post by bqsbarbqGAnC5Z » Sat May 12, 2012 4:45 am

Whoa awesome, I didn't even notice the Variables tab down there before you mentioned it. Thanks for the replies, Mark and Craig, this is perfect!

Post Reply