On 19 Dec 2002 at 4:22, Frank Heckenbach wrote:
[...]
AND there is a way to do it in Pascal. Some unions and structures are impossible to convert because there is no way to achieve the conversion in Pascal,
I don't remember if we talked about this, but can you give an example for something not convertible?
Here are some examples:
typedef enum _CM_ERROR_CONTROL_TYPE { IgnoreError=SERVICE_ERROR_IGNORE, NormalError=SERVICE_ERROR_NORMAL, SevereError=SERVICE_ERROR_SEVERE, CriticalError=SERVICE_ERROR_CRITICAL } SERVICE_ERROR_TYPE;
In this case, one just does something like: Const IgnoreError = SERVICE_ERROR_IGNORE; (in cases where it is sufficient to just refer to "IgnoreError" in the code) - but I have no idea how to translate the enum itself as defined.
Other examples:
typedef struct _LDT_ENTRY { WORD LimitLow; WORD BaseLow; union { struct { BYTE BaseMid; BYTE Flags1; BYTE Flags2; BYTE BaseHi; } Bytes; struct { DWORD BaseMid:8; DWORD Type:5; DWORD Dpl:2; DWORD Pres:1; DWORD LimitHi:4; DWORD Sys:1; DWORD Reserved_0:1; DWORD Default_Big:1; DWORD Granularity:1; DWORD BaseHi:8; } Bits; } HighWord; } LDT_ENTRY,*PLDT_ENTRY,*LPLDT_ENTRY;
typedef struct _DCB { DWORD DCBlength; DWORD BaudRate; DWORD fBinary:1; DWORD fParity:1; DWORD fOutxCtsFlow:1; DWORD fOutxDsrFlow:1; DWORD fDtrControl:2; DWORD fDsrSensitivity:1; DWORD fTXContinueOnXoff:1; DWORD fOutX:1; DWORD fInX:1; DWORD fErrorChar:1; DWORD fNull:1; DWORD fRtsControl:2; DWORD fAbortOnError:1; DWORD fDummy2:17; WORD wReserved; WORD XonLim; WORD XoffLim; BYTE ByteSize; BYTE Parity; BYTE StopBits; char XonChar; char XoffChar; char ErrorChar; char EofChar; char EvtChar; WORD wReserved1; } DCB,*LPDCB;
[...]
Well, I guess I'll leave everything as it is. Actually, I'm getting a little tired of this discussion, and unless really new points are brought up, I probably won't reply anymore.
Fine.
Keep in mind that there is a parsing conflict. I'm not working on it now. But when I will, and if it turns out that the `Integer (16)' etc. types are a serious problem in this regard, I'll simply drop them then (a bug is always more important than some non-standard feature). This means all who use it will have to change their code quite suddenly then.
In which case there needs to be an alternative solution - perhaps the one that you suggested.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/