Author Topic: Dummy functions ?!?!  (Read 1775 times)

Offline Leos

  • Mc. Print
  • *
  • Posts: 22
  • Wrecking Everything
    • View Profile
Dummy functions ?!?!
« 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 :/
« Last Edit: 2010-Oct-02 by Leos »
Leo.

GLBasic fan!

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1787
    • View Profile
    • Homepage
Re: Dummy functions ?!?!
« Reply #1 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 :-)

Offline Leos

  • Mc. Print
  • *
  • Posts: 22
  • Wrecking Everything
    • View Profile
Re: Dummy functions ?!?!
« Reply #2 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!
Leo.

GLBasic fan!

MrTAToad

  • Guest
Re: Dummy functions ?!?!
« Reply #3 on: 2010-Oct-02 »
Dummy functions don't seem to be needed any more now.

Offline Leos

  • Mc. Print
  • *
  • Posts: 22
  • Wrecking Everything
    • View Profile
Re: Dummy functions ?!?!
« Reply #4 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)
« Last Edit: 2010-Oct-02 by Leos »
Leo.

GLBasic fan!

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10745
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Dummy functions ?!?!
« Reply #5 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.