Discussions related to Visual Prolog
George
Active Member
Posts: 47 Joined: 19 Sep 2011 8:54
Unread post
by George » 16 Oct 2013 7:01
I'm getting the following error message during the run time..
========================================
Dump: 2013-10-11 09:12:22
----------------------------------------
Exception: systemException (runtime_exception)
System exception
Predicate name = format
Format = %-0.2f
error code = 1
ExtraInfo = Exception C00000FD: Stack overflow
continued() 2013-10-11 09:12:21
ThreadId: 3596
Class name: string
Predicate name: format
----------------------------------------
Exception: systemException (runtime_exception)
System exception
error code = 1
ExtraInfo = Exception C00000FD: Stack overflow
raised() 2013-10-11 09:12:21
ThreadId: 3596
Class name: runtime_exception
Predicate name: runtimeExceptionRaiser
The following is the code that I used on my Project
Code: Select all
RealVal = tryToTerm( real, SVal ) , %SVal input number in string format
FValue = string:: format ( "%-0.2f" , RealVal ) ,
I'm not sure, when the format predicate will through "Stack overflow" exception during the run time.
Could you please advice me ??
Thanks in advance..
Paul Cerkez
VIP Member
Posts: 106 Joined: 6 Mar 2000 0:01
Unread post
by Paul Cerkez » 16 Oct 2013 10:44
just out of curiosity, what happens if the Try fails? Are you sure the SVal is bound?
I get this kind of error In ASP/C# if I try to do something like this but the variable is unbound or is null.
try something like this to test it;
Code: Select all
RealVal = 0 + tryToTerm( real, SVal ) , %SVal input number in string format
FValue = string:: format ( "%-0.2f" , RealVal ) ,
if you get a zero, or it throws another type of exception, the problem could be in the SVal.
P.
AI Rules!
P.
George
Active Member
Posts: 47 Joined: 19 Sep 2011 8:54
Unread post
by George » 16 Oct 2013 11:39
just out of curiosity, what happens if the Try fails?
if the try fails, then I've written a trivial condition to return the value as "0".. I don't think, there will be an problem..
Are you sure the SVal is bound?
yes, It's always bound..
Any Thought's.. why this exception happened..??
Thanks in advance..
Vitaly Markov
Active Member
Posts: 40 Joined: 30 Nov 2003 0:01
Unread post
by Vitaly Markov » 16 Oct 2013 18:34
Code: Select all
RealVal = tryToTerm( real, SVal ) , %SVal input number in string format
FValue = string:: format ( "%-.2f" , RealVal ) ,
It is correct Code, I think.
What is the string of SVal that call exception?
Thomas Linder Puls
VIP Member
Posts: 1424 Joined: 28 Feb 2000 0:01
Unread post
by Thomas Linder Puls » 16 Oct 2013 19:20
I have not been able to reproduce the problem.
Can you reproduce it yourself?
What value does SVal have?
Regards Thomas Linder Puls
PDC
George
Active Member
Posts: 47 Joined: 19 Sep 2011 8:54
Unread post
by George » 17 Oct 2013 6:25
I'm still investigating on this issue.. It was happened during the run time.. I was not able to reproduce this issue when I had this in a separate test project.. I tried all possibilities(passing various inputs), but I'm not able to re-produce..
Any thought about this exception..
Since it is happening in the built-in predicate given by PDC.. I'm not sure, in which scenario this exception will thrown by this predicate..
I'm keep working on this.. Please suggest me what would be right way to investigate this issue.?
When the format/.. predicate will throw "Stack Overflow" exception..?
Thanks in advance..