*unknown on structure definition time
For example MYSQL_ROW:
The C definition is »typedef char **MYSQL_ROW; /* return data as array of strings */«
The PB structure could look like this:
Code: Select all
Structure MYSQL_ROW
Array field.s()
EndStructure
Structure MYSQL_LENGTHS
Array length.l()
EndStructure
Code: Select all
Structure MYSQL_ROW
OpenArray field.s
EndStructure
Structure MYSQL_LENGTHS
OpenArray length.l
EndStructure
mySQL still controls, fills and frees the memory - AND - off course knows the size of the array. (FieldCount = mysql_num_fields(*mySQL_Result))
This would be possible:
Code: Select all
*myRow.MYSQL_ROW = mysql_fetch_row(*mySQL_Result)
debug *myRow\field(3)
Or if there is no zero at the end:
Code: Select all
*myRow.MYSQL_ROW = mysql_fetch_row(*mySQL_Result)
*myLengths.MYSQL_LENGTHS = mysql_fetch_lengths(*mySQL_Result)
debug PeekS(*myRow\field(3), *myLengths\length(3))
Code: Select all
*mySQL_Row = mysql_fetch_row(*mySQL_Result)
*mySQL_Lengths = mysql_fetch_lengths(*mySQL_Result)
mySQL_FieldLength.l = PeekL(*mySQL_Lengths+4*3)
*mySQL_FieldPtr = PeekL(*mySQL_Row+4*3)
debug PeekS(*mySQL_FieldPtr, mySQL_FieldLength)
Code: Select all
Structure MYSQL_ROW
field.s[255]
EndStructure
I hope I was clear enough.
Any chance to implement this? - Would be great!
Thanks - sverson