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 - pickhotpos() return the position of a hot-key in a list item http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 pickhotpos()        Return the position of a hot-key in a list item
------------------------------------------------------------------------------
 Declaration
   pick.hdr

 Syntax
   func uint pickhotpos extern
   param value _SLIST pList, ;
         value uint   uItem

 Arguments
   pList is a list pointer.
   uItem is a list item index.

 Return
   Position of the hot-key character.

 Description
   The pickhotpos() function returns the position of the hot-key character
   in the specified item, or 0 if this item has no hot-key defined.

   This function can only be used with string lists, but not with generic
   lists that contain non-character data.

 Example
   #define EXAMPLE_LIST
   #include example.hdr

   proc Test_pickhotpos
   vardef
      _SLIST pList
   enddef
   pList := pickinit()
   
   pickadd( pList, "&Open" )
   pickadd( pList, "&New" )            // item 2
   pickadd( pList, "-" )
   pickadd( pList, "&Save" )
   pickadd( pList, "Save &as..." )     // item 5
   pickadd( pList, "-" )
   pickadd( pList, "&Print" )
   pickadd( pList, "Setup p&rinter" )
   pickadd( pList, "-" )               // item 9
   pickadd( pList, "&Quit" )
   
   ? pickhotpos( pList, 2 )            // output: 1
   ? pickhotpos( pList, 5 )            // output: 6
   ? pickhotpos( pList, 9 )            // output: 0
   
   pickclear( pList )
   endproc

   proc main
   Test_pickhotpos()
   endproc

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