Page 1 of 1

Pseudotypes Relation to C Types

Posted: Sat Feb 03, 2024 4:28 am
by Inner
How do these Pseudo Types relate to their C Types?

p-ascii,p-utf8,p-bstr,p-unicode,p-variant

Or am I missing the point?

Re: Pseudotypes Relation to C Types

Posted: Sat Feb 03, 2024 7:06 am
by DarkDragon
Inner wrote: Sat Feb 03, 2024 4:28 am How do these Pseudo Types relate to their C Types?

p-ascii,p-utf8,p-bstr,p-unicode,p-variant

Or am I missing the point?
They're all pointers to either ascii, utf-8, bstr, unicode or variant data. It depends on what you want to do with them in C.

All would be fine as void*
p-ascii is usually but not always unsigned char* or uint8_t*
p-utf8 is usually but not always also unsigned char* or uint8_t*, but you have to interpret it as utf-8
p-unicode is usually but not always unsigned short* or wchar_t* or uint16_t* as UCS2.

The other two are COM related.

Re: Pseudotypes Relation to C Types

Posted: Sun Feb 04, 2024 4:53 pm
by infratec
They are used to automatically convert a PB unicode string to the required string format.
It is not a new type of variable.

But you are the expert I'm only always here :wink:

Re: Pseudotypes Relation to C Types

Posted: Sun Feb 04, 2024 5:28 pm
by Inner
infratec wrote: Sun Feb 04, 2024 4:53 pm They are used to automatically convert a PB unicode string to the required string format.
It is not a new type of variable.

But you are the expert I'm only always here :wink:
:o :lol: :lol: :lol: I seriously wouldn't put any stock in that title at all, and I'd hardly call myself an expert, town dunce maybe..

I've just been using it for 21 years! which makes Pure Basic the longest lived language in my life bar none.