Dummy functions ?!?!

Previous topic - Next topic

Leos

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 :/
Leo.

GLBasic fan!

Moru

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 :-)

Leos

Quote from: Moru on 2010-Oct-02The @ 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!
Leo.

GLBasic fan!

MrTAToad

Dummy functions don't seem to be needed any more now.

Leos

#4
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)
Leo.

GLBasic fan!

Kitty Hello

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.