Order procedure called

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5665
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Order procedure called

Post by Kwai chang caine »

Hello at all

Does the PB IDE have a tool for see the order of procedures is called ?
A style of STACK of Procedures, not for memory, like this :idea:

Code: Select all

Declare One()
Declare Two()
Declare Three()
Declare Four()

Procedure Four()
 Debug "Procedure : Four()"
 Three()
EndProcedure

Procedure Three()
 Debug "Procedure : Three()"
 Two()
EndProcedure

Procedure Two()
 Debug "Procedure : Two()"
EndProcedure

Procedure One()
 Debug "Procedure : One()"
 Four()
EndProcedure

Debug "Order of procedures called"
One()
Have a good day
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
Axolotl
Addict
Addict
Posts: 936
Joined: Wed Dec 31, 2008 3:36 pm

Re: Order procedure called

Post by Axolotl »

So you're looking for a function similar to what Debugger | Callstack does at runtime?
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5665
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Order procedure called

Post by Kwai chang caine »

I don't know, i not use CALLSTACK it's too much hard for the little head of KCC :oops:

Me i search since several years, not for always, but often, for see what is the path the code use during the first line, and also the procedure called, until the last line of code
But mainly the procedures calls, in fact is not for my codes, because it's me who have coded (Easy to recognize...it don't works :mrgreen:)

But when i want understand how a big and complex code of foreign programmer works, it's sometime very difficult to see the route and order of procedures calleds
The worst is the callback(), because you believe "Procedure 1" call "Procedure 2" but you don't see this devilish callback is inserted between the "Procedure 1" and "Procedure 2"
For the moment i do step by step, but sometime the program crash because it not want you stop the events during the loop :cry:
And also when you have a MsgBox and a callback impossible to know where is line of the MsgBox, when you stop it's always in the callback :twisted:
And also several example i not have in my memory, but with a tool who show to you

Code: Select all

Main => Procedure1 => CallBack => Procedure2 => Main
You see immediately what is the procedure you must to see or modify for have the result you want :idea:
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5665
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Order procedure called

Post by Kwai chang caine »

And better when you put a Breakpoint, you know exactely what procedure is called since you running the application :idea: 8)
Obvioulsy, the more simple is to insert a "Debug #PB_Compiler_Procedure" in each procedure but it's not really easy to do if the code is very big :|
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
Post Reply