Page 1 of 1

Memory location not allowed after 6.02

Posted: Mon May 06, 2024 11:06 pm
by matalog
I have this code, which works in 6.02, but doesn't work after

Code: Select all

Global.i *buf
 ReadFile (0, "C:\txt.txt")
*buf = AllocateMemory (Lof (0))
ReadData (0, *buf, Lof(0))
CloseFile (0)
After 6.02 it reports an error that Native types can't be used with pointers.

What should I change to get this working in later versions?

Re: Memory location not allowed after 6.02

Posted: Mon May 06, 2024 11:08 pm
by jacdelad

Code: Select all

Global *buf
 ReadFile (0, "C:\txt.txt")
*buf = AllocateMemory (Lof (0))
ReadData (0, *buf, Lof(0))
CloseFile (0)
Simply remove the ".i" since pointers already automatically have the correct variable type.

Re: Memory location not allowed after 6.02

Posted: Mon May 06, 2024 11:15 pm
by matalog
jacdelad wrote: Mon May 06, 2024 11:08 pm
Simply remove the ".i" since pointers already automatically have the correct variable type.
Thanks.