Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 10 Monaten
Letzter Beitrag:
vor 9 Monaten, 4 Wochen
Beteiligte Autoren:
SolutionJ-Reg, Paulo Oliveira, Fabrice Harari

re-calling of same Global Procedure

Startbeitrag von SolutionJ-Reg am 25.10.2016 09:53

Hi,

I have a procedure called e.g. GP_UpdateSP. This is called from various other places in my system. The procedure currently uses a number of data sources for its reference tables.

The problem I have is that the procedure can be called (indirectly from itself).

Supposing it all starts from another procedure called GP_UpdatePO. This procedure may call GP_UpdateSP. GP_UpdateSP may then call GP_UpdatePO(with different parameters) which may then call GP_UpdateSP.

If this happens then GP_UPdateSP errors because the Data Sources already exist. How can I get around this?

Many thanks
Reg

Antworten:

Hi Reg

my first answer is : DON'T do it

You are in recursive situation, and recursivity is NOT supported in wlanguage... The call stack is just too short for this kid of programming.

Now if you really want to do it and wait for the crash, then you'll have to declare your data sources OUTSIDE/BEFORE starting to call your procedures... But it still is a really bad idea.

Best regards

von Fabrice Harari - am 25.10.2016 10:15
With recursive code and data source you have a problem.

check the help for Data source (Type of variable) in the Notes section.

http://doc.windev.com/en-US/?1514053

von Paulo Oliveira - am 25.10.2016 10:19
Fabrice, Paulo...

Thanks for the help, sorry I haven't replied earlier. This problem caused me a major issue with a system that I've been trying to dig my out of for the past few days.

Kind Regards
Reg

von SolutionJ-Reg - am 27.10.2016 11:38
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.