Eike Lange wrote:
In C, it is possible to give an enumeration some predefined values like: enum my_type { first, second, third=44};
How do I do that in Pascal?
I suggest to use constants (which I think what C programmers mean when they use enums like that ;-):
const first = 0; second = 1; third = 44;
This way, you can choose any values you like, and they are in fact integers, like enums are in C.
Khimenko Victor wrote:
Ahh. So it's array, not just pointer. In this case something like type mysqlrowa=array[0..100] of CString; mysqlrow=^mysqlrowa; will do. And you can use row^[0], row^[1], ... , row^[100] (there are no limit in C but in Pascal you NEED some limit - otherwise compiler will complain).
Ok, thats not exactely what I want to do.
Yeah ? How so ?
What about row[10000]?
Make it array[0..10000] then. Surely MySQL have some upper limer for number of rows.
You could do `array [0 .. MaxVarSize div SizeOf (CString) - 1]'. MaxVarSize is the maximum size of a variable, so you declare the array as large as possible and avoid any further limits. That's an ugly BP style trick, and I usually suggest to avoid it, but for interfacing to C arrays it's necessary.
Frank