ClsFunction and ClsParameter classes

nicholas.jj.taylor

Member
Licensed User
Longtime User
I want a ClsFunction class that a programmer can use like so...

B4X:
Private Sub aFunction(IntParameter1 as Int, StrParameter2 as String)
   Dim ThisFunction as ClsFunction
   ThisFunction = Me.GetFunction

   If ThisFunction.AccessModifier = ThisFunction.ACCESS_MODIFIER_PRIVATE then
      ToastMessageShow(ThisFunction.Name & " is a Private function!")

   End If

   If ThisFunction.Parameters.Size > 0 then
      For IntIdx = 0 to ThisFunction.Parameters.Size - 1
         Dim Parameter as ClsParameter
         ClsParameter = ThisFunction.Parameters.Get(IntIdx)

         ToastMessageShow(ClsParameter.Name & ", " & ClsParameter.Type)

      Next

   End If

End Sub

Thee are so many applications.

Initially, I want it for debugging, so that I can pinpoint my exceptions programatically like thus:

B4X:
Try
   ...Code...

Catch
   LogColour(LastException & ": " & ThisFunction.ClsClass.Name & " " & ThisFunction.Name, Colours.Magenta)
End Try
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…