enrty point

Just starting out? Need help? Post your questions and find answers here.
KiwiBob
New User
New User
Posts: 1
Joined: Fri Nov 23, 2018 7:48 am

enrty point

Post by KiwiBob »

Hi all, I may be missing something but I am used to having a WINMAIN or PBMAIN entry point to an app.
I have been hunting the help all night and cannot find an equivalent, is the first proc in an app considered the entry point?


Cheers,
BOB
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: enrty point

Post by Josh »

Code: Select all

Procedure Main()
  ;Any code
EndProcedure

Main()
sorry for my bad english
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: enrty point

Post by Mijikai »

What u write first gets executed first.

Code: Select all

EnableExplicit;<- always use this!

Procedure.i Something()
 Debug "-> SOMETHING!"
EndProcedure

Procedure.i Main()
  Debug "MAIN!"
  Something();<- call Something() from Main()
EndProcedure

Main();<- lets execute Main()

End;<- properly end
User avatar
Danilo
Addict
Addict
Posts: 3037
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: enrty point

Post by Danilo »

KiwiBob wrote:I have been hunting the help all night and cannot find an equivalent, is the first proc in an app considered the entry point?
The code starts directly in global space:

Code: Select all

OpenWindow(0,0,0,800,600,"Window",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
Special entry points are required when writing DLL's, see: Building a DLL
Post Reply