Menu with List not working
sharpnova
16 Aug 2013, 11:46communicationsTerminalList = NewStringList()
list add (communicationsTerminalList, "Accept transmission")
ShowMenu ("You turn to the communications terminal. A blinking light indicates you are receiving a live transmission.", communicationsTerminalList, Logout, false) {
}
spits out:
"Error running script: Too many parameters passed to ShowMenu function - 5 passed, but only 4 expected"
Is there a workaround for this bug?
list add (communicationsTerminalList, "Accept transmission")
ShowMenu ("You turn to the communications terminal. A blinking light indicates you are receiving a live transmission.", communicationsTerminalList, Logout, false) {
}
spits out:
"Error running script: Too many parameters passed to ShowMenu function - 5 passed, but only 4 expected"
Is there a workaround for this bug?

jaynabonne
16 Aug 2013, 12:05I'm not sure what "Logout" is, but ShowMenu takes four parameters:
<function name="ShowMenu" parameters="caption, options, allowCancel, callback">
where "callback" is typically the inline script as you have it in your example. So you would pass the caption, the options list and a flag for allowCancel and then the callback script (That's why I called out "Logout", since the rest seem to fit.)
<function name="ShowMenu" parameters="caption, options, allowCancel, callback">
where "callback" is typically the inline script as you have it in your example. So you would pass the caption, the options list and a flag for allowCancel and then the callback script (That's why I called out "Logout", since the rest seem to fit.)
sharpnova
16 Aug 2013, 14:39Logout was put there automatically. This code was generated by me using the script menu to create a Show menu.
So does this mean no one has been able to get Showmenu to work unless they wrote it by hand/removed this unecessary argument?
So does this mean no one has been able to get Showmenu to work unless they wrote it by hand/removed this unecessary argument?
sharpnova
16 Aug 2013, 14:48Also I don't understand what you're talking about.
I do not have any inline script. And even in the original form I pasted this code in in my original post, I only see four arguments to the ShowMenu function:
1: "You turn to the communications terminal. A blinking light indicates you are receiving a live transmission."
2: communicationsTerminalList
3: Logout
4: false
I do not have any inline script. And even in the original form I pasted this code in in my original post, I only see four arguments to the ShowMenu function:
1: "You turn to the communications terminal. A blinking light indicates you are receiving a live transmission."
2: communicationsTerminalList
3: Logout
4: false

jaynabonne
16 Aug 2013, 15:39What version of Quest are you using? I have 5.4.1, and when I put in a bare bones "Show a menu", I get in script:
ShowMenu ("This is a caption", list, true) {
}
I'm at a loss as to why you have that Logout in there. Would you be able to post the file? Did you ever enter the word "Logout" anywhere?
As far as the parameters go, the curly braces { } that follow the function params in the parentheses is a script that is actually passed as the fourth parameter. So you should only see three parameters within the parens, and then the script itself is the fourth. Normally, the script would have something in it.
ShowMenu ("This is a caption", list, true) {
}
I'm at a loss as to why you have that Logout in there. Would you be able to post the file? Did you ever enter the word "Logout" anywhere?
As far as the parameters go, the curly braces { } that follow the function params in the parentheses is a script that is actually passed as the fourth parameter. So you should only see three parameters within the parens, and then the script itself is the fourth. Normally, the script would have something in it.

sharpnova
16 Aug 2013, 15:44I'm using the web-based version. So I assume the latest version.

jaynabonne
16 Aug 2013, 15:57Hmm. I went to a web version test project and added a "Show a menu" script, and in the code view I got:
ShowMenu ("This is a caption", list, true) {
}
so I don't know how that happened for you. If you delete the script and add it again, does it happen again?
ShowMenu ("This is a caption", list, true) {
}
so I don't know how that happened for you. If you delete the script and add it again, does it happen again?
sharpnova
17 Aug 2013, 12:25No. If I add new showmenu's then the "logout" parameter is not included.

jaynabonne
17 Aug 2013, 12:36Ok, good. I don't know what happened that one time, but I'm glad it's not a permanent problem. 
