• Miércoles 24 de Abril de 2024, 06:38

Autor Tema:  ClassDefinition  (Leído 1254 veces)

davidmolina1

  • Miembro activo
  • **
  • Mensajes: 51
    • Ver Perfil
ClassDefinition
« en: Miércoles 30 de Septiembre de 2009, 23:30 »
0
Hola.

¿Alguien ha usado la clase ClassDefinition de PB?

En el código que viene de ejemplo en PB no funciona porque sd toma un valor nulo cuando se ejecuta c_obj.FindMatchingFunction( "Find", ls_args)

¿Alguna sugerencia?

Gracias de antemano

Citar
string ls_args[]
string s, lineend
integer li
ScriptDefinition sd
ClassDefinition c_obj

ls_args[1] = "string"
ls_args[2] = "long"
ls_args[3] = "long"

c_obj = CREATE classDefinition
sd = CREATE ScriptDefinition

sd = c_obj.FindMatchingFunction( "Find", ls_args)

IF NOT IsValid(sd) or isnull (sd) THEN
   messagebox ("", "No matching script")
ELSE

   //The uf_scriptinfo function gets information about the function that matched the signature and builds a string. Scriptobj is the ScriptDefinition object passed to the function:
   lineend = "~r~n"
   
   // Script name
   s = s + sd.Name + lineend
   // Data type of the return value
   
   s = s + String (sd.ReturnType) + lineend
   //.DataTypeOf
   // List argument names
   
   s = s + "Arguments:" + lineend
   
   FOR li = 1 to UpperBound(sd.ArgumentList)
      s = s + sd.ArgumentList[li].Name + lineend
   
   NEXT
   
   // List local variables
   
   s = s + "Local variables:" + lineend
   
   FOR li = 1 to UpperBound(sd.LocalVariableList)
      s = s + sd.LocalVariableList[li].Name + lineend
   
   NEXT
   
   messagebox ('', s)

END IF