[Gambas-user] How to get current procedurename, codelinenumber and raising element

Fabien Bodard gambas.fr at ...626...
Fri Nov 29 18:41:15 CET 2013


2013/11/29 ub2 at ...36... <ub2 at ...36...>:
> Dear cracks
>
> After fooling hours/days in Wikipedia, Googling etc I'd like to place my
> issue here (before driving nuts). If this is not appropriate please sb
> indicate where I can find help. Thanks.
>
> For debugging I'd like to write the following info in a
> string: procedure name, code line number, element which has started
> current running/failing procedure.
>
> my code:
> '-----------------------------------
> 'Public Procedure ProcXYZ(....
> '
> '   Dim $CheckVar as String
> '   Dim $Testmode as Integer
> '   Dim $ResSPos as Result
> '
> '   ...
> '      $ResSPos = HiModSql.Sql2Res("TblVerknAkt",".....
> '         $x = $ResSPos!x
> '         If $Testmode > 0 Then
> '        $CheckVar &= Chr(10) & ?codeline? &": $x=" & $x
> '        ...
> '   ...
> '   Catch
> '      Message.Warning("Catch ?procname?, Error=" & Error.code & ", " &
> '        Error.text & Chr(10) & "$CheckVar:" & Chr(10) & $CheckVar, "ok")
> '
> 'End
> '------------------------------------
>
> My questions:
> How to deviate Debug into a string?
in the catch part :
myerror = Error.text &/ error.where ... for example
http://gambasdoc.org/help/comp/gb/error/text?v3
> How to get codelinenumber? (Is there a list of useful things?)
Error.Where
> How to get element which started procedure?
Error.Where
http://gambasdoc.org/help/comp/gb/error/where?v3
>
>
> Please apologize if code formatting is not state of the art.
> I'm autodidact.
>
>
> Thanks for your help.
>
> Regards,
> ub2
>
>
> Note: I'm an quite enthusiastic Gambas user. Thanks, you're doing great.
> Go ahead and do not bother never ending "Basic-Discussion-bigots".
>
>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user



-- 
Fabien Bodard




More information about the User mailing list