ASCIIZ are zero terminated strings, use them wherever you would
use char * or char[]. The STRING type used in PB corresponds
to the BSTR in C (SysAlloc* family).
The difference in return types is only apparent - PB supports
casting but in a different manner than C. Casting in PB is done
by assigning a return type to another as in (using the
getservbyname example):
Code:
LOCAL dwReturn AS DWORD LOCAL ptServent AS servent PTR 'pointer to servent structure dwReturn = getservbyname( "HTTP", "TCP" ) 'cast the return value ptServent = dwReturn 'alternatively (quicker and more succint) you could do: ptservent = getservbyname( "HTTP", "TCP" ) ... access the structure
a variable use VARPTR(<DATATYPE> ) instead &<DATATYPE> as in C.
PowerBASIC is very flexible and offers UNION, UDTs and a host
of other features.
Hopefully this will be enough to get you started.
Cheers
Florent
------------------
Leave a comment: