GLBasic forum

Main forum => GLBasic - en => Topic started by: spudgunjake on 2011-Feb-11

Title: Types and pointers to chars
Post by: spudgunjake on 2011-Feb-11
having trouble with types, can any one help. been right thick. Or is it better to use INLINE function.

I need a pointer to a char in my type,

TYPE My_Test

   *mTargetBuf    
   mWidth
   mHeight
   
ENDTYPE
Title: Re: Types and pointers to chars
Post by: MrTAToad on 2011-Feb-11
You would need to use INLINE if you want pointers
Title: Re: Types and pointers to chars
Post by: Moru on 2011-Feb-12
Pointers aren't very "BASIC" are they? :-)
Title: Re: Types and pointers to chars
Post by: doimus on 2011-Feb-12
No. Each time you think of pointers and BASIC, a cute puppy dies.

But then again, PEEKs and POKEs are kind of pointers, right?
( tiny squeak echoes in the distance )
Title: Re: Types and pointers to chars
Post by: Moru on 2011-Feb-12
No more than FOR, IF and WHILE :-)
Title: Re: Types and pointers to chars
Post by: Kitty Hello on 2011-Feb-12
what do you need the pointer for? They are hard to handle, when you have to be sure the memory is properly allocated and deleted afterwards.
Title: Re: Types and pointers to chars
Post by: spudgunjake on 2011-Feb-12
I thought I would need to use INLINE, I want to convert some old code from BLITZMax to GLBasic.

thanks for the nod.
Title: Re: Types and pointers to chars
Post by: hardyx on 2011-Feb-16
I think you can convert the pointer to a dynamic array of some single or complex type. You can use Redim later, for allocate this field to the desired size.