Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - prompt1st() find prompt beginning with specified character http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 prompt1st()         Find prompt beginning with specified character
------------------------------------------------------------------------------
 Declaration
   menu.hdr

 Syntax
   func int prompt1st extern
   param value byte bSearchChar

 Arguments
   uSearchChar is the ASCII code of the search character.

 Return
   The identifier number of the first prompt beginning with the specified
   character, or zero if a matching prompt is not found.

 Description
   The prompt1st() function scans the currently active prompt messages and
   returns the identifier of the first prompt beginning with the specified
   character.

 Example
   #define EXAMPLE_MENU
   #include example.hdr

   vardef
      uint uChoice
   enddef
   
   proc Test_prompt1st
   
   // Lookup the first prompt starting with a 'Q'
   clear
   @ 1, 2 prompt "Files"
   @ 2, 2 prompt "Modify"
   @ 3, 2 prompt "Quit"
   @ 6, 0 ?? prompt1st( 'Q' )             // prints 3
   menu to uChoice
   
   /*
   Lookup the first prompt starting with an 'N'. Note that there are two
   prompts starting with an 'N'. The lookup stops after the first
   matching prompt is found - here, this is the 2nd prompt.
   */
   clear
   @ 1, 2 prompt "Files"
   @ 2, 2 prompt "New"
   @ 3, 2 prompt "Next"
   @ 4, 2 prompt "Quit"
   @ 6, 0 ?? prompt1st( 'N' )             // prints 2
   menu to uChoice
   endproc

   proc main
   Test_prompt1st()
   endproc

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson