• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

how to set a Type

Started by Chris Chancellor, November 04, 2018, 06:31:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chris Chancellor

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 ?




Charles Pegge

#1
Hi Chris,

Your last definition is correct. I'm not sure what the 'dword' does in the PB definition.

Chris Chancellor

Thanxx Charles

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