Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FileWrite > 32K

282 views
Skip to first unread message

Robert Frey

unread,
Jul 26, 1999, 3:00:00 AM7/26/99
to

How do I use FileWrite to write a file more than 32K. Does anyone have any
example code?

Robert Frey
Embryon

Ken Drendel

unread,
Jul 26, 1999, 3:00:00 AM7/26/99
to Robert Frey
Open the file in Line! instead of Stream!.


Robert Frey wrote:

--
Hope this helps!

Kenneth A. Drendel
email Kdre...@HotMail.com
Icq# 34027019

Bjorn Andre Lie

unread,
Jul 26, 1999, 3:00:00 AM7/26/99
to

Try open write-file using FileOpen( filename, LineMode! ......)

Then write the file line by line using the FileWrite function

Regards
Bjørn André Lie

Bruce Armstrong [TeamSybase]

unread,
Jul 26, 1999, 3:00:00 AM7/26/99
to

Just write to the file in a loop. The following is from the of_FileWrite
function in PFC:

Integer li_FileNo, li_Writes, li_Cnt
Long ll_BlobLen, ll_CurrentPos
Blob lblb_Data
Writemode lwm_Mode

If ab_Append Then
lwm_Mode = Append!
Else
lwm_Mode = Replace!
End if

li_FileNo = FileOpen(as_FileName, StreamMode!, Write!, LockReadWrite!, lwm_Mode)
If li_FileNo < 0 Then Return -1

ll_BlobLen = Len(ablb_Data)

// Determine the number of writes required to write the entire blob
If ll_BlobLen > 32765 Then
If Mod(ll_BlobLen, 32765) = 0 Then
li_Writes = ll_BlobLen / 32765
Else
li_Writes = (ll_BlobLen / 32765) + 1
End if
Else
li_Writes = 1
End if

ll_CurrentPos = 1

For li_Cnt = 1 To li_Writes
lblb_Data = BlobMid(ablb_Data, ll_CurrentPos, 32765)
ll_CurrentPos += 32765
If FileWrite(li_FileNo, lblb_Data) = -1 Then
Return -1
End if
Next

FileClose(li_FileNo)

Return 1

On Mon, 26 Jul 1999 11:50:33 -0400,

in powersoft.public.powerbuilder.general


Robert Frey <fr...@embryoninc.com> wrote:
>How do I use FileWrite to write a file more than 32K. Does anyone have any
>example code?
>
>Robert Frey
>Embryon
>
>

---
Bruce Armstrong [TeamSybase] | Romac/Source International
mailto:Bruce.A...@teamsybase.com | mailto:jo...@sourcela.com
| http://www.romac-source.com

Preach the gospel at all times. If necessary, use words. [Francis of Assisi]
http://www.kidbrothers.org http://www.fccwc.org
http://www.harvest.org/knowgod/index.htm

-----------== Posted via the PFCGuide Web Newsreader ==----------
http://www.pfcguide.com/_newsgroups/group_list.asp

Robert Frey

unread,
Jul 26, 1999, 3:00:00 AM7/26/99
to
Excellent. Thanks.

Rob

Bruce Armstrong [TeamSybase] wrote in message ...

0 new messages