Oxygen Basic

Programming => Bugs & Feature Requests => Topic started by: Brian Alvarez on April 20, 2020, 03:42:53 PM

Title: Pointer issue
Post by: Brian Alvarez on April 20, 2020, 03:42:53 PM
Hello Charles, im struggling because pointers do not behave the same in 32bit and 64 bit compilations,
why is that and how can i make them work the same?

For example this:

Code: [Select]
function assign(int d, byval sys * udt) as long
Invoked like this class method:

Code: [Select]
   EXAMPLE abc
   udt.assign(1, @abc)

And used like this inside udt.assign:

Code: [Select]
        ' Clear previous contents.
        copy(@udt, z, len(z))

Works in 32 bits... crashes in 64 bit mode.
Title: Re: Pointer issue
Post by: Charles Pegge on April 21, 2020, 01:53:48 AM
Hi Brian,

When you are passing an address or anon pointer directly, the function should look like this:

Code: [Select]
function assign(int d, sys udt) as long
...
' Clear previous contents.
        copy(udt, z, len(z))


Take care. If you had covid, it can return with a harder bite.
Title: Re: Pointer issue
Post by: Brian Alvarez on April 21, 2020, 03:08:16 PM
Thanks charles, that worked pretty well!

 And yes... im taking good care of myself. In the past weeks i had fever that came and went,
headaches sore throat and other symptoms, but i never had problems breathing... it was
probably something else.

How are you?
Title: Re: Pointer issue
Post by: Charles Pegge on April 22, 2020, 06:29:22 AM

No viral symptoms. Trying to keep as fit as possible, as I can't afford to be below par looking after my Mum. She is 94 on the 25th April.