Let me see... The problem is due to put PASCAL to C. If you see in Pascal functions, I put an arrow pointing some problems, as I don't know if the code I put in C is or isn't correct...

=>For example, there is an error in the "SaveFieldValue(FieldPtr field, UInt16 Offset)" function in the lines

DmWrite(RecordPtr, &Offset, FieldText, StrLen(FieldText) + 1);
and
Offset += StrLen(FieldText) + 1;
saying for each one "function call 'StrLen ({lval} struct FieldType *)' does not match 'StrLen (const char *)' "
Note: I call this function like "SaveFieldValue(NameFieldPtr, Offset);". Is it correct, or should I put a & before OffSet? =>SaveFieldValue(NameFieldPtr, &Offset);


=>Another error exists in the function "SetFieldValue( FieldPtr field, UInt16 fieldLen, UInt16 Offset)" in the lines
StrCopy( FieldText, &RecordPtr[Offset]); saying "function call 'StrCopy({lval} struct FieldType *, DBRecord *)' does not match 'StrCopy(char*, const char*)' ", so I don't know if i'm calling the offset attribut correctly, or if i'm using RecordPtr correctly;


and in the line
Offset += StrLen(RecordPtr[Offset]) + 1; saying "function call 'StrLen({lval} DBRecord)' does not match 'StrLen(const char *)' "


=>Another error in the function "UInt16 GetFieldLength(FieldPtr field)", in the line
result = StrLen(FieldText) + 1; saying
"function call 'StrLen({lval} struct FieldType *)' does not match 'StrLen(const char *)' "


Well... Those are the bugs that compiler spoted... If you quickly read the Pascal functions, you can see that the change to C is almost trivial, with the exception of some pointers, and I think that the problems are from that change....If someone could help... I would be very glad!

Andrà Augusto

Marcelo van Kampen wrote:

Wel...

   Try be more specific... What exacly is your problem ? Where the
compiler gives you an error message? Did the compiler give you a
Warning message about pointers? What i would suggest you is to take
some C tutorials and to know how to use the Debugger, view the memory
and know the difference between pointers and variables (the memory
viewer from pods helps on this). Know what you do when you pass & and
* in front of a variable.

    By the name of the variables, i would tell that you speak
portuguese... So here is a link for a good C tutorial(in portuguese):
http://www.mtm.ufsc.br/~azeredo/cursoC/c.html

Cheers

Marcelo van Kampen
Unesp, Bauru, Brazil



-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to