Data Type Error Argument 6 FWriteline
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?
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
From
D.J.W. van Kooten@21:1/5 to
All on Sat Dec 25 01:44:54 2021
Replying on message of Fri, 24 Dec 2021 15:06:49 -0800 (PST) from
[email protected]:
Hello
[email protected]
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
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
On Friday, December 24, 2021 at 11:06:50 PM UTC,
[email protected] wrote:
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
what I mean
"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)))
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)