Function Call...

Since I’m keeping Matt and Jonathan busy on one thread, I figure I can monopolize STDoug while I’m at it :wink:

Being the lazy scripter that I am (and my quest for readability), I have a handler that simply checks what flavor an OS is (ie Mac vs. Windows):

to windows
	return (global currOS is in global WIN_OS_LIST)
end windows

to macintosh
	return (global currOS is in global WIN_OS_LIST)
end macintosh

So I can say things like
if windows() then do_win_something_or_other

The problem is, if I actually run this call, I get two return values back:
put macintosh()
true
true

What incredibly obvious thing have I missed?

I’m guessing that there’s not enough information here to answer your question. How are you determining the value of currOS? Do you by any chance have a handler called currOS? Why does the macintosh handler use the same check against the same list as the windows handler?

That’s a global variable, determined in another handler (when we log into the SUT)

Do you by any chance have a handler called currOS?

Nope.

Why does the macintosh handler use the same check against the same list as the windows handler?

Because I typed it wrong :oops: :lol: It should have read MAC_OS_LIST

Okay, I’ll bite… :wink:

I’m not sure you’re actually getting two values back. I think you may be seeing a small bug that sometimes displays values twice in the Run window when you use a put command in the Do box. Try “put macintosh() into foo” and then “put foo” and see if it looks any different.

Allen,

What version of Eggplant are you running? You may be seeing an older, less nicely formatted version of the following output:

Thu, 12/4/08 2:43:21 PM	START		Running demo2.script
put colorCheck()
true
returned: true

Thanks Matt/Doug. I thought I was running 4.1.2, but apparently I was still on 4.1.1. It was not returning two values, it was part syntax error (where I was using the function call), part formating in the run window. Upgrading to 4.12 made me see that.

It’s solved, either way. :wink:

Thanks for your great help, as always.