-2

How to change this choice 1, choice 2 ,choice 3 in popu menu to special words (passing by variables from array). With out using the popup properties menu. Means: contents of array svar[2] instead of choice 1 contents of array svar[3] instead of choice 2 .. so on. so each time the value of choice 1, choice 2 will differ. global searchStr global replaceStr global Ftext global myArrayToBe global myArraylength global gvar on menuPick pItemName put the number of lines of (the keys of myArrayToBe) into myArraylength repeat with i=1 to myArraylength if myArrayToBe[i] contains Ftext then put myArrayToBe[i] into Svar answer Svar split Svar by colon put Svar[2] into gvar answer gvar end if end repeat switch pItemName put gvar into pitemName case gvar answer Ftext break case "Choice 2" answer "bye" break case "Choice 3"answer "Please" break end switch end menuPick

Zam
  • 367
  • 2
  • 17
  • 1
    Pleasesplityourquestionintoparagraphsandusetherestofthetoolstoformatitcorrectly. Walloftextsarenoteasytoread. – user Apr 01 '15 at 13:31

1 Answers1

0

Hard to see in your question what you are asking for, but you can set the menu options by using the text of button

If you want to change the menu on the fly when the user clicks, you can do that in the on mouseDown handler:

on mouseDown
   set the text of me to "One" & return & "Two" & return & "three"
end mouseDown

if you then have a global variable sVar and would like to populate the menu just when it is about to be shown you can do that also:

on mouseDown
  global sVar
  put sVar into tVar # Copy array
  combine tVar with return
  set the text of me to tVar
end mouseDown

If you want to change the first two alternatives based on an array sVaryou can use:

 put the text of button "myMenuButton" into tText
 put sVar[1] into line 1 of tText
 put sVar[2] into line 2 of tText
 set the text of button "myMenuButton" to tText
hliljegren
  • 426
  • 3
  • 9
  • I need to change the text of choice 1, choice 2 in the pop up menu by passing text in variables. – Zam Apr 02 '15 at 06:30