%%HP: T(3)A(D)F(.);
@ FINDOBJP : General to search for an object within the HP49G port Memory
@ Copyright 2001 10/28/01 Stanley HH Lui
@ 
@  input:    object_name|common_string   object_type   pn 
@      object_name | common_string : if it is a 'name', then search only for that name
@                                                 : if it is a string (type 2), then will match for name(s) which
@                                                   contain the string in their names 
@                                                 if it is a name, the name must starts with :1: or :2:
@                                                 This routine does not support :0: 
@
@      object_type
@        : 1    (5 - HP type) =  list
@        : 2    (8)               =  program
@        : 3    (11)             =  graphics object
@
@      port_number
@        :1    for port 1
@        :2    for port 2
@      
@  output:  {'name1' 'name2' ...'nameN'} 
@              if object(s) are found.
@              {} if no object is found.
@
@  
@  Note: Only  LIST, PROGRAM, and GROB type objects can be search
@  
@
\<< RCLF {} {} \-> oname otype  pn     fs plst vlst \<<
   
   {5 8 11} otype GET 'otype' STO
   IF oname TYPE 2 == THEN 2 SF ELSE 2 CF END
   pn PVARS DROP 'plst' STO
   IF plst {} \=/ THEN
     1 plst SIZE FOR i
        IF 2 FC? THEN
          IF plst i GET oname SAME THEN
            vlst plst i GET + 'vlst' STO
            plst SIZE 1 + 'i' STO
          END
        ELSE
          IF plst i GET \->STR oname POS THEN
             vlst plst i GET + 'vlst' STO
          END
        END
     NEXT
   END

   fs STOF vlst

\>>  \>>