Page 1 of 2

Syntax error message: *(p+1)\v

Posted: Fri May 05, 2006 8:45 am
by IceSoft
Missing a solution to change 'temporary' the pointer value:

I get a syntax error message with this one:

Code: Select all

*(p+1)\v
@Fred,
Please let it working (it is very important for using pointers)
Or give me the correct syntax ;-)

Posted: Fri May 05, 2006 9:10 am
by Psychophanta
Ther are many solutions. This one could help, i hope:

Code: Select all

*p.struc

*temp.struc=*p+SizeOf(struc)*1
*temp\v

Posted: Fri May 05, 2006 9:13 am
by IceSoft
Psychophanta wrote:Ther are many solutions. This one could help, i hope:

Code: Select all

*p.struc

*temp.struc=*p+SizeOf(struc)*1
*temp\v
Sorry, that is not a solution!
That's only a workaround.

A solution don't need a second variable!

Posted: Fri May 05, 2006 9:36 am
by freak
PB is not C...

Posted: Fri May 05, 2006 9:38 am
by Fred
It's not a bug, please post in the appropriate section.

Posted: Fri May 05, 2006 9:39 am
by Psychophanta
freak wrote:PB is not C...
Of course :wink:
PB is much more complex than C if the user wants, and much more easy than C if the user wants. That's the power. :D

Posted: Fri May 05, 2006 9:42 am
by Psychophanta
Fred wrote:It's not a bug, please post in the appropriate section.
Fred , are you awake??? did you drink yesterday?
This is in request section! :lol:

Posted: Fri May 05, 2006 9:43 am
by Fred
Because i just moved it :P.

Posted: Fri May 05, 2006 9:44 am
by Psychophanta
Fred wrote:Because i just moved it :P.
:oops:

Posted: Fri May 05, 2006 9:47 am
by IceSoft
But this is a bottleneck.

@Fred,
I hope you add this very early.
Maybe it works if you change the syntax check only?

Code: Select all

(*p+1)\v
or

Code: Select all

*(p+1)\v

Posted: Fri May 05, 2006 10:06 am
by freak

Code: Select all

PeekB(*p+1) ; Or use whatever type you have there

Posted: Fri May 05, 2006 10:09 am
by IceSoft
freak wrote:

Code: Select all

PeekB(*p+1) ; Or use whatever type you have there
Ok, one more workaround.
It is not so fast as a directly pointer access is.

I hope the PB-Team adds this feature on the first 'PB Servicepack 1'.

Posted: Fri May 05, 2006 10:11 am
by Fred
As fr34k says, it's not C, and we don't plan to introduce a weird syntax for this kind of stuff.

Posted: Fri May 05, 2006 10:16 am
by IceSoft
Fred wrote:As fr34k says, it's not C, and we don't plan to introduce a weird syntax for this kind of stuff.
Come one @fred,
It is not weird. It is fast ;-)

Look this is not weird:

Code: Select all

*p+1
But you say this is weird (I using another sytax here)

Code: Select all

*p+1\v
Why?

Posted: Fri May 05, 2006 10:17 am
by Fred
Because '1' isn't a variable so you can't acces its field ;). If it's only a speed matter, we can still put PeekX() in the compiler it self to avoid an extra call..