Author Topic: Close GLbasic name space.  (Read 3078 times)

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3366
  • Integrated Brain
    • View Profile
Close GLbasic name space.
« on: 2015-Aug-21 »
Hi guys I have a doubt because I don't understand too much the Inline Documentation (for the language not for the explanation).

When I use Inline, automatically namespace GLBasic is closed?¿, if not how I have to do for leave __GLBASIC__ without usefull.

I read something similar to this.

Inline
{ using name space __cplus_plus__


}namespace __GLBASIC__ // for turn again to GLbasic namespace.

thanks.

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: Close GLbasic name space.
« Reply #1 on: 2015-Aug-21 »
I dont understand your question, you already posted the answer. When you start INLINE you are still in namespace __GLBASIC__, if you want to leave it, you do so with simply writing }, if you are done with your stuff, you need to reopen the namespace before you call ENDINLINE. So it looks this way:
Code: GLBasic [Select]
INLINE
} // closed namespace __GLBASIC__, you probably are in global namespace now

// do that stuff here, that you dont want to be inside GLBasic namespace

namespace __GLBASIC__ { // reopen GLBasic namespace
ENDINLINE
BTW you rarely need to do this, most INLINE stuff that you probably do, can savely be done inside GLBasic namespace. I usually just opend my own namespace inside __GBASIC__, which also works fine.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3366
  • Integrated Brain
    • View Profile
Re: Close GLbasic name space.
« Reply #2 on: 2015-Aug-21 »
Ok Kanonet thanks I don't know when you put "}" closed the namespace, I think you have to do something like closenamespace or use another...
I'm very newbie with C++

Thanks a lot for the clarify me.
 

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: Close GLbasic name space.
« Reply #3 on: 2015-Aug-21 »
What are you doing, that you need to close the namespace? Like I said, in most cases you can just use C++ code in INLINE without closing the namespace.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3366
  • Integrated Brain
    • View Profile
Re: Close GLbasic name space.
« Reply #4 on: 2015-Aug-21 »
Nothing interesting Kano, only is for learning.
I read in somebooks mix namespaces can be a bad practice  , how I comment I'm learning C++ (I'm not profesional programmer)  and is really interesting mix it with GLbasic.

Thanks again.