Hi devteam!
When compiling the transported VO code, it generated an error "The name 'ErrorStack' does not exist in the current context". XSharp does not support this functionality or is it necessary to configure something?
P.S. From my point of view, this function is easily reproduced in NET using System.Diagnostics.StackTrace.
Best regards,
Leonid
Finding ErrorStack
Finding ErrorStack
Hi Leonid,
This is not a documented function in VO, so probably it was just overlooked. Maybe Robert is aware of it (especially since he was the person maintaining VO for some years), but for me it's the first time I hear about it. What does it do exactly?
This is not a documented function in VO, so probably it was just overlooked. Maybe Robert is aware of it (especially since he was the person maintaining VO for some years), but for me it's the first time I hear about it. What does it do exactly?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Finding ErrorStack
Hi Chris,
The ErrorStack() function returns the current call stack, which appears as "CallStack: ..." in error messages in VO.
For example:
MYFUNC (Line:50)
MYCLASS:MYMETHOD (Line:100)
START (Line:5)
My colleagues and I quite often use it to find problems.
The ErrorStack() function returns the current call stack, which appears as "CallStack: ..." in error messages in VO.
For example:
MYFUNC (Line:50)
MYCLASS:MYMETHOD (Line:100)
START (Line:5)
My colleagues and I quite often use it to find problems.
Best regards,
Leonid
Leonid
Finding ErrorStack
Hi Leonid,
OK, thanks, I will add it for the next build. In the meantime of course you can also implement it yourself in your code, or I can send you the code.
Edit: Line information will not be the same as in VO though, it cannot point to the _entity_ line number. Instead you will get a file line number.
OK, thanks, I will add it for the next build. In the meantime of course you can also implement it yourself in your code, or I can send you the code.
Edit: Line information will not be the same as in VO though, it cannot point to the _entity_ line number. Instead you will get a file line number.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Finding ErrorStack
Thanks Chris,
I already wrote for myself (it is quite simple in implementation), but when it appears as part of XSharp, I will delete my implementation.
I already wrote for myself (it is quite simple in implementation), but when it appears as part of XSharp, I will delete my implementation.
Best regards,
Leonid
Leonid
Finding ErrorStack
Hi Leonid,
Oh, in this case, why don't you save us the time to implement it and just post the source code of your implementation here?
Oh, in this case, why don't you save us the time to implement it and just post the source code of your implementation here?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Finding ErrorStack
With pleasure! I tried to make the return result exactly the same as it was in VO. The code may not comply with the writing rules for NET or something else is missing, but you can fix it as you wish.
Best regards,
Leonid
Best regards,
Leonid
- Attachments
-
- ErrorStack.zip
- (513 Bytes) Downloaded 70 times
Best regards,
Leonid
Leonid
Finding ErrorStack
Hi Leonid,
The code looks fine to me, thanks a lot for sending! It only needs a couple small adjustments, the nActivation param is typed as a DWORD in VO and also in the result you need to omit the call to the function itself, try this in VO and X# to compare the results:
but the adjustments needed are very minor, thanks again!
The code looks fine to me, thanks a lot for sending! It only needs a couple small adjustments, the nActivation param is typed as a DWORD in VO and also in the result you need to omit the call to the function itself, try this in VO and X# to compare the results:
Code: Select all
FUNCTION Start() AS INT
FUNCTION1()
RETURN 0
FUNCTION FUNCTION1() AS VOID
Func2()
FUNCTION Func2() AS VOID
? ErrorStack()
? ErrorStack(0)
? ErrorStack(1)
? ErrorStack(2)
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Finding ErrorStack
I did dwActivation as a DWORD at first, but the XSharp compiler threw a cast error (StackFrame:FrameCount declared as INT). I did not do type casting, but simply did nActivation as INT (without control over negative values).
Best regards,
Leonid
Leonid
Finding ErrorStack
Hi All,
please note that line numbers will only show up if you deliver a current pdb file with your binaries.
I'm doing that all the time: Wolfgang
please note that line numbers will only show up if you deliver a current pdb file with your binaries.
I'm doing that all the time: Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it