Code: Select all
InRange(*pTextRange.i, prop.i)
Code: Select all
InRange(*pTextRange.i, prop.i)
Yes it is normal. Just remove the native type on the pointer variable (i.e. the '.i' part). In previous versions of PureBasic having a native type didn't make sense and wasn't needed, because pointers always held an integer value, but no error was thrown. Now it throws an error.le_magn wrote: Sat Mar 22, 2025 7:33 pm Hi all, in PB6.20 AND PB6.21Beta1 i get this error "Native types can't be used with pointers", at this line:
But with 6.12 it compile ok, is this normal?Code: Select all
InRange(*pTextRange.i, prop.i)
Ok thank'sDemivec wrote: Sat Mar 22, 2025 7:52 pm Yes it is normal. Just remove the native type on the pointer variable (i.e. the '.i' part). In previous versions of PureBasic having a native type didn't make sense and wasn't needed, because pointers always held an integer value, but no error was thrown. Now it throws an error.
Code: Select all
*value.b = address
*value\b
What has changed in this respect in that version?
PB SyntaxMijikai wrote: Sun Mar 23, 2025 10:05 am Imho. this syntax would make sense if you could actually use it like this:
Code: Select all
*value.b = address *value\b
Code: Select all
Global bVal.b, *value.byte
*value = @bVal
*value\b = 10
Debug bVal
Code: Select all
Global.b a,*b
a = 123
*b = @a
Debug *b\b
Remove ".i"le_magn wrote: Sat Mar 22, 2025 7:33 pm Hi all, in PB6.20 AND PB6.21Beta1 i get this error "Native types can't be used with pointers", at this line:
But with 6.12 it compile ok, is this normal?Code: Select all
InRange(*pTextRange.i, prop.i)
Code: Select all
InRange(*pTextRange, prop.i)
Remove ".i"
Code: Select all
InRange(*pTextRange, prop.i)
How does your suggested method for pointer declarations know which structure is being referenced by the pointer?Mijikai wrote: Sun Mar 23, 2025 12:14 pm @mk-soft, thats how it currently works.
What is your point?
Mby this is more readable:Code: Select all
Global.b a,*b a = 123 *b = @a Debug *b\b
Code: Select all
Structure Byte
b.b
EndStructure
Structure b
b.i
honey.b
EndStructure
;Global a.b, *b.Byte ;current syntax for pointer declarations
Global.b a,*b ;suggested modification to syntax for pointer declarations
a = 123
*b = @a
Debug *b\b
First of all there is nothing wrong with how things currently work.Demivec wrote: Sun Mar 23, 2025 8:12 pm How does your suggested method for pointer declarations know which structure is being referenced by the pointer?
**Begin Soap Box warning**Mijikai wrote: Sun Mar 23, 2025 8:58 pmFirst of all there is nothing wrong with how things currently work.Demivec wrote: Sun Mar 23, 2025 8:12 pm How does your suggested method for pointer declarations know which structure is being referenced by the pointer?
If someone wants to bring back this *pointer.i syntax for whatever reason i just suggest to make it useful in a different way.
Support all type variables for pointers and make them work like i showed in my examples.
Its simple if is .b with a *poiner its .Byte, .w is .Word and so on...
It would be shorter, cleaner and still very easy to understand.