SalCompileAndEvaluate() stopps application

forum.gupta.bugreport (2005-2010)
RainerE
Germany
Posts: 2275
Joined: 27 Apr 2021, 12:40
Location: Germany

SalCompileAndEvaluate() stopps application

Post by RainerE » 14 Jun 2005, 13:38

 Posted by:  Rainer Ebert 

I had implemented a (little bit complex) class construct where I used
SalCompileAndEvaluate() to execute functions based on a given string which
includes function name and parameter: "Call SalCompileAndEvaluate(
'__Id2Name(2)', ...).

After some thousand calls of SalCompileAndEvaluate(), the application
(compiled with TD2.1PTF4) became unstable. Either the application simply
stopped execution in the middle of a function (pushbuttons/menues were still
working) or an invalid error message was displayed.

Fazit: SalCompileAndEvaluate() is not as stable as necessary(for me).

Solution: Replaced SalCompileAndEvalute() by an if-else if construct (20
else-ifs) as follows:
If sFct = '__Id2Name'
Set sRet = __Id2Name( sArg )
Else If ...
...

Rainer

Niels Allerheiligen

Re: SalCompileAndEvaluate() stopps application

Post by Niels Allerheiligen » 14 Jun 2005, 13:59

 Posted by:  Niels Allerheiligen 

Hi Rainer.

Do you mean something like this?

Function: CallFunc
Parameters:
String: p_sFunctionToBeCalled
Actions:
Call SalCompileAndEvaluate( p_sFunctionToBeCalled, nError, nErrorPos,
nReturn, sReturn, dtReturn, hWndReturn, TRUE, SalContextCurrent( ) )

What is your 'invalid error message'? Or is it random?

Fazit -> conclusion

Ouch.

We mostly use XSalScript now and haven't had a problem since.

-Niels-

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2385
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: SalCompileAndEvaluate() stopps application

Post by Jeff Luther » 14 Jun 2005, 17:04

 Posted by:  Jeff Luther 

"After some thousand calls" - how about a test to call your "functions
based on a given string" directly and bypass SalCAE()? What happens then?

You have a big variable in what you are doing--the many functions calls--so
it isn't clear to me (yet) that SalCAE() is the culprit. It could be a
stack issue, for example, directly related to all your function calls.

When execution stops, where is it exactly in your code?

"an invalid error message was displayed" - and like the other respondee to
your msg, I'd like to know what the error msg. is and where it comes from.
Maybe the title of the error msg. box will give a clue?

Best Regards,
Jeff Luther/PC Design
www.pulpcards.com/gupta/

RainerE
Germany
Posts: 2275
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: SalCompileAndEvaluate() stopps application

Post by RainerE » 16 Jun 2005, 11:10

 Posted by:  Rainer Ebert 

Niels,

yes I mean what you described.

The error message is random.

Rainer

RainerE
Germany
Posts: 2275
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: SalCompileAndEvaluate() stopps application

Post by RainerE » 16 Jun 2005, 11:19

 Posted by:  Rainer Ebert 

Jeff,

I've replaced SalCompileAndEvaluate('sFct(sParam)',...) by
if sFct = 'a'
Set sRet = a(sParam)
else if sFct = 'b'
Set sRet = b(sParam)
...
a, b, ... are the same (and unchanged) function.
Now it works stable - even if I call the function much more often than it
was possible with SalCAE().

The execution stopps on different places in my sourcecode.

The "invalid" error message is randomly or does not appear and execution
simply stopps. If it comes, it comes from TD.

But replacing SalCAE() by an if-else if-else - construct eliminated all my
problems (as replacing SalPause() by Sleep() did some month ago; similiar
problem, TD stopped somewhere during execution after heavily calling
SalPause()).

Rainer

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2385
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: SalCompileAndEvaluate() stopps application

Post by Jeff Luther » 16 Jun 2005, 16:53

 Posted by:  Jeff Luther 

Last thought: If you have not already, save all your source in text format,
for a recompile and retry. (I don't recall if you had said your problem was
in the EXE version of your appl. only...)

If you have been working in binary it is possible there's a corrupt area
in your APP files. Saving -> text -> recompile has long been a way to
'clean out' such areas.

Best Regards,
Jeff Luther/PC Design
www.pulpcards.com/gupta/

RainerE
Germany
Posts: 2275
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: SalCompileAndEvaluate() stopps application

Post by RainerE » 17 Jun 2005, 20:07

 Posted by:  Rainer Ebert 

I save all my sourcecode files (programs, library) only in text format and
thus for years (I do this since it was possibe - it was not possible with
SqlWindows 5.x/4.x.

Rainer

Return to “gupta.bugreport”

Who is online

Users browsing this forum: [Ccbot] and 0 guests