Problem Passing Parameters: (Help) Pretty Please!?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
stephenmcnutt
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 107
Joined: Fri Nov 10, 2006 8:58 pm
Contact:

Problem Passing Parameters: (Help) Pretty Please!?

Post by stephenmcnutt » Sun Mar 09, 2008 6:20 pm

This is just a syntax problem, and I've been using Revolution long enough that this shouldn't be a problem, but I guess I use it sporadically rather than constantly, so I never get beyond these troubles. Anyhow...

I'm trying to pass parameters to a custom handler called iconFlasher. Here's the statement in which I call the handler:

iconFlasher(("space" & whichSpace), 12400+Spaces[whichSpace,1], 12000+Spaces[whichSpace,1], 500, 300, 1000, 3)

Here's the beginning of the custom handler showing the parameters I'm expecting it to receive:

on iconFlasher buttonToFlash, iconBright, iconRegular, intervalFirst, intervalOthers, intervalLast, flashCount

To help troubleshoot, I've put an "answer" statement at the beginning of the handler to see how these parameters are being loaded, and it seems that all the information I'm trying to send the handler is getting loaded into the FIRST parameter (buttonToFlash) only. Here's the answer statement:

answer "buttonToFlash=" & buttonToFlash && "iconBright=" & iconBright && "iconRegular=" & iconRegular && "intervalFirst=" & intervalFirst && "intervalOthers=" & intervalOthers && "intervalLast=" & intervalLast && "flashCount=" & flashCount

and here's the dialog that results:

buttonToFlash=space18,12409,12009,500,300,1000,3 iconBright= iconRegular= intervalFirst= intervalOthers= intervalLast= flashCount=

As you can see, only the first parameter is being loaded, and it's getting everything, which SHOULD be distributed among the other parameters. The statements ARE being evaluated as I intend, though. That is, buttonToFlash SHOULD be space18, and iconRegular SHOULD be 12409, etc.

What simple thing am I doing wrong? By the way, putting spaces or not putting spaces after the commas in the parameter lists doesn't have any effect. Thanks in advance.

Mark Smith
Posts: 179
Joined: Sat Apr 08, 2006 11:08 pm
Contact:

Post by Mark Smith » Sun Mar 09, 2008 6:23 pm

You seem to have the whole lot in brackets - this will make the handler see the whole lot as one parameter. Remove the outermost brackets and it'll probably be fine...

Best,

Mark

Post Reply