DarkDragon wrote:Maybe it would be better to disallow standard types for pointers.
Yes, that's what was about to write but gardening took priority
In fact, in my understanding of pointers with PB...
*ptr it's a pointer pointing to some memory area, not addressable in a structured way through the same pointer, so you have to use the Peek[?] family of functions to read from it (or use a different pointer type)
*ptr.Integer is a pointer to an area you want/need to access in a structured way and containing a basic type of data (Integer, Long, etc.)
*ptr.STRUCTNAME is the same as above but using a user defined structure
*ptr.i, *ptr.b, *ptr.c, etc are simply meaningless, or if you really want to put it that way, equivalent to *ptr
So what suggested by Danilo *could* have a meaning (I understand your point of view), but I would found better to remove the meaningless definition altogether and stick to the explicit structured pointer definition.
Danilo wrote:
I think this is what luis said. I had the same problem many times.
It works, but it would be easier to use if PB could support this.
Exactly. The C way would be perfect, but considering
*name in pb is a name variable different from
name probably it would be a little more difficult to implement it that way for Fred than, for example, something like this:
Code: Select all
; ascii mode
TEST$ = "01234567890"
*ptr.byte = @TEST$
*ptr\b = Asc("@") ; this works, first byte changed
*ptr\b + 3 = Asc("@") ; this is meaningless now, it could be used to obtain what I was asking ?
Debug TEST$