Where is this statement?luis wrote:since this is probably due to the fact PB doesn't check by design for an existing definition of a structure when one is referenced using pointers inside a structure.Psychophanta wrote: Native types really STILL CAN BE USED with pointers.
[5.10] Native types can't be used with pointers
Re: [5.10] Native types can't be used with pointers
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: [5.10] Native types can't be used with pointers
@luis, Sorry but you seem to talk about other things.
What i am referring to is other issue. Check the title of this thread please.
What i am referring to is other issue. Check the title of this thread please.
Re: [5.10] Native types can't be used with pointers
I have not installed PB 5.10 here, so can't check if this really works.Psychophanta wrote:Requested for years about this needed fixation for consistence and readability, and finally here it is.
However, there is still the buggy feature:
Native types really STILL CAN BE USED with pointers.
Look & see:Code: Select all
Structure so *locationinmem.b; <- ?? EndStructure f.so\locationinmem=78 Debug f\locationinmem
But if that is the case as you write, please make a bug-report

MFG PMV
Re: [5.10] Native types can't be used with pointers
No idea, probably nowhere. Just try it:IceSoft wrote:Where is this statement?
Code: Select all
Structure mela
item.pera ; not allowed
EndStructure
Code: Select all
Structure mela
*item.pera ; allowed
EndStructure
What are you referring to then ?Psychophanta wrote:@luis, Sorry but you seem to talk about other things.
What i am referring to is other issue.
Haven't you defined a pointer to a native type (now forbidden) inside a structure ?
If so, I'm talking about the same thing.
Ok, wait... Done. It's the same title I was remembering.Psychophanta wrote: Check the title of this thread please.

You better report it but don't know if Fred will fixed it, since this is probably due to the fact PB doesn't check by design for an existing definition of a structure when one is referenced using pointers inside a structure.
Are we ok now ?
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: [5.10] Native types can't be used with pointers
I am full of reporting bugs and lots of them are rejected, so do report you if you want...
Re: [5.10] Native types can't be used with pointers
So we are ok now and we were referring to the same thing, right ?
OK !
OK !
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: [5.10] Native types can't be used with pointers
Tha case is that there is allowed to define pointers with native types, that's all.luis wrote:So we are ok now and we were referring to the same thing, right ?
OK !
If the root (cause) of it is that there is allowed to define pointers with any type, including not existing ones, it is other (still worse) thing.
Re: [5.10] Native types can't be used with pointers
It's not a bug, it's a special case by design or you couldn't do something like this:Psychophanta wrote: If the root (cause) of it is that there is allowed to define pointers with any type, including not existing ones, it is other (still worse) thing.
Code: Select all
Structure t1
*item.t2
EndStructure
Structure t2
*item.t1
EndStructure
And yes, this is probably why the ability to define a pointer to a native type slipped through in this case.
Anyway, I'll do the bug report then

"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: [5.10] Native types can't be used with pointers
I disagree with that "by design feature", because, even with a single compiling pass, the compiler should register (tracking) all the things it is reading, and check whether there is defined later or not...
You see what i mean?
Besides of that, why this doesn't work?. There is another inconsistence, you see?
You see what i mean?
Besides of that, why this doesn't work?. There is another inconsistence, you see?
Code: Select all
Structure t1
item2.t2
EndStructure
Structure t2
*item.t1
EndStructure
Re: [5.10] Native types can't be used with pointers
No, because it's generating code on the way down while it's reading the source.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: [5.10] Native types can't be used with pointers
That is dangerous, and for sure in the future Fred will realize of it.luis wrote:No, because it's generating code on the way down while it's reading the source.
Re: [5.10] Native types can't be used with pointers
No again for the same reason above. t2 is not referenced in your case, it's part of the structure you are trying do define.Psychophanta wrote: Besides of that, why this doesn't work?. There is another inconsistence, you see?Code: Select all
Structure t1 item2.t2 EndStructure Structure t2 *item.t1 EndStructure
In case of the pointer, it's just a pointer, in case of the whole structure the compiler need to know the structure definition.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: [5.10] Native types can't be used with pointers
It's now forbidden as well (to forbid native type in pointer structure field), for consistency.
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: [5.10] Native types can't be used with pointers
Still, that kind of issues have a real solution in one pass compiling scheme.Fred wrote:It's now forbidden as well (to forbid native type in pointer structure field), for consistency.
I don't say to do it now, but to take in account for future would be a good thing.
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: [5.10] Native types can't be used with pointers
@Fred, at the moment, to give an idea to solve this, i suggest just to leave it as it is now, but just invalidating only the native types (.c , .b , etc.) for the pointers inside structures.