[V4RB] vServer cursor.export
Charles Yeomans
yeomans at desuetude.com
Tue Apr 13 18:01:07 CDT 2004
On Apr 13, 2004, at 5:33 PM, Robert Nichols wrote:
> Ruslan,
>
> I know you have been unable to get cursor.textexport to produce a file
> on the client machine (V4RB). (I can't even get it to produce a file
> on the server, when giving a path as parameter).
>
> Would it be possible to get a cursor to export that same text into an
> RB string variable? Anything to reproduce that functionality we had
> prior to vServer would make a HUGE difference.
>
Of course it is trivial to take a VCursor and dump its contents
yourself to a tab-delimited file, or an Rb string. In fact, it would
be easy to write a subroutine that extends the VCursor class to do
this. For example --
Function Dump(Extends c as VCursor, f as FolderItem)
dim t as TextOutputStream
dim TAB as String
dim theRecord as String
dim i as Integer
//parameter-checking for f omitted
t = f.OpenAsTextFile
If t Is Nil then
//handle as you like
Return
End if
If c.FirstRecord then
TAB = Chr(9)
Do
theRecord = c.Field(1).GetString
For i = 2 to c.FieldCount
theRecord = TAB + c.Field(i).GetString
Next
t.WriteLine theRecord
Loop Until NOT c.NextRecord
End If
t = Nil
End Function
--------------
Charles Yeomans
More information about the Valentina
mailing list