April 19, 2024, 08:05:59 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


$main

Started by Brian, November 29, 2020, 10:01:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

Hi,

I understand that the use of $main in a single file compile will be ignored, but when you are compiling Projects, the help file says it "Marks the beginning execution point of the program. Used in project mode compiling."

So where exactly is the "beginning execution point" ?

Brian



LarryMc

Quote from: undefinedSo where exactly is the "beginning execution point" ?
At the top of the source code file where you started building your project. Usually the file where you create your main screen. Anything in the file before the $MAIN directive will not be acted upon (totally ignored).
But your source code files can be linked in any order  and the file where your program starts may wind up being the last file linked  thus the $MAIN directive..

In the IWB IDE there are 65 source files.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Thanks, Larry,

So, basically, it is at the top of your program listing, before anything else, unless the 'anything else' is a comment line!

Brian

LarryMc

Quote from: Brian on November 30, 2020, 08:29:55 AMSo, basically, it is at the top of your program listing, before anything else, unless the 'anything else' is a comment line!

correct
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library