What am I missing please?
Replying on message of Fri, 24 Dec 2021 15:06:49 -0800 (PST) from jrol...@gmail.com:
Hello jrol...@gmail.comThank you very much Dick, you were correct, assigning the string to a variable solved it. Thank you again
What am I missing please?Not an obvious one. I would first assign the line to a string variable
and then see if FWriteLine(ptrHandle,cString) works. If not, replace
the string with something simple.
FWriteLine is not strong typed and you do not need to supply nCount as
this will then take the length of the string. So a longint requested
error doesn't directly make sense.
Maybe something is wrong with the string due to the construction with
single and double quots and this should become clear by assigning to a
string variable (and then add to it part by part)
Dick
Hi I'm getting a "Function: _GET_LONG" error (Type String, requested type LONGINT)
What am I missing please? Heres the code involved:
For i := 1 to oDb:Fcount
AAdd(aRay, {oDb:FieldInfo(DBS_NAME, i), oDb:FieldInfo(DBS_TYPE, i), oDb:FieldInfo(DBS_LEN, i), oDb:FieldInfo(DBS_DEC, i)})
FWriteLine(ptrHandle, "AAdd(aDBF,{ " + '"' + AllTrim(oDb:FieldInfo(DBS_NAME, i)) + '", ' + '"' + AllTrim(oDb:FieldInfo(DBS_TYPE, i)) + '", ' + AllTrim(Str(oDb:FieldInfo(DBS_LEN, i))) + ', ' , AllTrim(Str(oDb:FieldInfo(DBS_DEC, i))))
? "AAdd(aDBF,{ " + '"' + AllTrim(oDb:FieldInfo(DBS_NAME, i)) + '", ' + '"' + AllTrim(oDb:FieldInfo(DBS_TYPE, i)) + '", ' + AllTrim(Str(oDb:FieldInfo(DBS_LEN, i))) + ', ' , AllTrim(Str(oDb:FieldInfo(DBS_DEC, i)))
Next
This line of code gives the error,
FWriteLine(ptrHandle, "AAdd(aDBF,{ " + '"' + AllTrim(oDb:FieldInfo(DBS_NAME, i)) + '", ' + '"' + AllTrim(oDb:FieldInfo(DBS_TYPE, i)) + '", ' + AllTrim(Str(oDb:FieldInfo(DBS_LEN, i))) + ', ' , AllTrim(Str(oDb:FieldInfo(DBS_DEC, i))))
While this line does not and works fine
? "AAdd(aDBF,{ " + '"' + AllTrim(oDb:FieldInfo(DBS_NAME, i)) + '", ' + '"' + AllTrim(oDb:FieldInfo(DBS_TYPE, i)) + '", ' + AllTrim(Str(oDb:FieldInfo(DBS_LEN, i))) + ', ' , AllTrim(Str(oDb:FieldInfo(DBS_DEC, i)))
What am I missing please?It's the last part of the line that is wrong, + ', ' , AllTrim(Str(oDb:FieldInfo(DBS_DEC, i))). I think the final , (comma) should be a + (plus sign), or the final ' (apostrophy) should be at the end of the line. If you break the line down you will see
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 220:44:53 |
Calls: | 6,622 |
Calls today: | 4 |
Files: | 12,171 |
Messages: | 5,318,035 |