read in string from keyboard

Hi,

does somebody know, if there is a possibility to read in a string from keyboard and set it as value to a string in a function?


I have something like the following function and i would like to ask user what the value of 'word' is before i proceed.

Menu "functions"
    Submenu "myfunc"
        "execute myfunc", myfunc()
    End
End


Function/S myfunc()
  String word
  word =      //and here i want to ask user which value it should be
 
                  //do something with 'word'
  return word
End



All other solutions which i already have are not friendly enough.
First one is to set the value of 'word' in the console as a global variable before starting myfunc().
The second is to implement this function with a parameter and start the function from the console (As far i can see, there is no possibility to start a function with parameters from a menu).

Best regards,
Shalashaska

P.S.: Sorry for my bad english. ;)
I hope it is not a stupid question but i already tried to search for solutions and didn't find any.
Do you already know about prompt/doprompt or is that not friendly enough?

Menu "functions"
    Submenu "myfunc"
        "execute myfunc", myfunc()
    End
End


Function/S myfunc()
  String word
  prompt word, "Enter a word"
  DoPrompt "MyFunc Parameters", word
  if (V_Flag)  
    return ""  // the user hit cancel instead of entering a word
  endif
  return word
End



The above suggestion is the way to go, but one addition is if you do not want to create a new menu called "Functions" then you can change this name to some of the built-in menus (such as "Macros") and access them there, instead of potentially cluttering your menu bar with more menus.