Overload A Global Function In PowerBuilder
if one function you need to pass multiple parameters, you can refer to the form below
Example Function
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | $PBExportHeader$f_log.srf Global Type f_log From function_object End Type Type Prototypes Subroutine OutputDebugString (String as_msg) Library "kernel32.dll" Alias For "OutputDebugStringA" End Prototypes Forward Prototypes Global Subroutine f_log (Readonly String as_msg) Global Subroutine f_log (throwable at, Readonly Integer ai_nu) Global Subroutine f_log (Readonly Integer ai_nu) End Prototypes Global Subroutine f_log (Readonly String as_msg); OutputDebugString (as_msg) End Subroutine Global Subroutine f_log (throwable at, Readonly Integer ai_nu); String ls_message ls_message = Error.Text If IsNull (Error.Text) Or Error.Text = "" Then ls_message = at.getMessage () OutputDebugString (Error.Object + "." + Error.ObjectEvent + ": line " + String (Error.Line) + ": " + ls_message) End Subroutine Global Subroutine f_log (Readonly Integer ai_nu); If IsValid (Error) Then OutputDebugString (Error.Object + "." + Error.ObjectEvent + ": line " + String (Error.Line) + ": " + Error.Text) End If End Subroutine |
Example Used:
1 2 3 | f_log("Message Log") f_log(t_throwable_caught, populateError (0, "")) f_log(populateError(0, "Error Error....")) |
Get From Internet
Good Luck!