GLBasic forum

Main forum => GLBasic - en => Topic started by: Leos on 2010-Oct-02

Title: Dummy functions ?!?!
Post by: Leos on 2010-Oct-02
Hi everybody...

Can someone explain me the use of dummy functions?

1-why/when to use it

2-is it necessary to use a @? because i've tried without it and it still works, so whats that for?

3- how it changes the C++ code behind the scene? (not that i would understand everything, but..)

Thanks in advance!

EDIT: i had a look at some threads and the help file, but couldn't find what I'm looking for about dummy functions :/
Title: Re: Dummy functions ?!?!
Post by: Moru on 2010-Oct-02
I think it is like this:

A dummy function you place after your main code to make GLBasic compiler end the main function so you can start creating your own functions in C.

The @ in front of the dummy function is only there so the function doesn't clutter up the list of functions in the right window.

I haven't done this but I remember someone saying something like this at least. Not sure why otherwise to use dummy functions, they just take up space :-)
Title: Re: Dummy functions ?!?!
Post by: Leos on 2010-Oct-02
The @ in front of the dummy function is only there so the function doesn't clutter up the list of functions in the right window.

This is what I thought :)

I understand it must be there before you use C code... I just wanted to know why x)

Thanks Moru!
Title: Re: Dummy functions ?!?!
Post by: MrTAToad on 2010-Oct-02
Dummy functions don't seem to be needed any more now.
Title: Re: Dummy functions ?!?!
Post by: Leos on 2010-Oct-02
They are still needed here, at least in the examples where it goes out of the __GLBASIC__ namespace
like before this:

Code: (glbasic) [Select]
INLINE
}
...something...

namespace __GLBASIC__ {
ENDINLINE

and this kind of thing must be in the end of the code?
(Hmm, maybe I've just answered my own question? :S)
EDIT: But if I didn't, someone explain it to me, please x)
Title: Re: Dummy functions ?!?!
Post by: Kitty Hello on 2010-Oct-05
You only need the dummy function (just any function) right under the main program entry point, if you mess around with global inline stuff.
It's just because there is no "ENDFUNCTION" for the main program.