Jose's Read Only Forum 2023

IT-Consultant: Charles Pegge => OxygenBasic => Topic started by: Chris Chancellor on November 04, 2018, 06:31:18 PM

Title: how to set a Type
Post by: Chris Chancellor on November 04, 2018, 06:31:18 PM
Hello Charles

i tried to translate a type from PB to O2 ,  but gotten an Illegal type error message upon compilation

code in PB

TYPE HD_LAYOUT DWORD
   prc   AS RECT PTR        ' RECT *prc
   pwpos AS WINDOWPOS PTR   ' WINDOWPOS *pwpos
END TYPE


code in O2 that cannot be compiled

TYPE HD_LAYOUT  as sys
         RECT PTR  prc                          ' RECT *prc
         WINDOWPOS PTR     pwpos         ' WINDOWPOS *pwpos
END TYPE




this cannot be compiled in O2

TYPE HD_LAYOUT  sys
         RECT PTR  prc                          ' RECT *prc
         WINDOWPOS PTR     pwpos         ' WINDOWPOS *pwpos
END TYPE





and only the below code works  in O2 during compilation  but it gives error when running the program?
as i have omitted AS sys


TYPE HD_LAYOUT
         RECT PTR  prc                          ' RECT *prc
         WINDOWPOS PTR     pwpos         ' WINDOWPOS *pwpos
END TYPE



so how to resolve this ?  how to assign a type  (as a group)  to sys ?



Title: Re: how to set a Type
Post by: Charles Pegge on November 04, 2018, 10:40:13 PM
Hi Chris,

Your last definition is correct. I'm not sure what the 'dword' does in the PB definition.
Title: Re: how to set a Type
Post by: Chris Chancellor on November 05, 2018, 12:56:32 AM
Thanxx Charles

looks like in this case, there is no  1 to 1 direct translation from PB to O2