Link to home
Start Free TrialLog in
Avatar of xo123
xo123

asked on

LibraryExport() for long script

I used LibraryExport() to export a Window object in PB5.
But the object is too large that it can only export partially.

How can I fix the problem if I want to use  script instead of the Export Painter
to export objects?
Avatar of namasi_navaretnam
namasi_navaretnam
Flag of United States of America image

Are you using PB 5.0 16 bit? Migrate to 32bit PB 5.0 then LibraryExport will work for string length greater than 64K.

16 bit string datatype can only hold 64K.
Btw, this is not PB limitation, but OS limitation.
Avatar of xo123
xo123

ASKER

I think I'm using 32bit.
This is the info from 'About'
    PowerBuilder Enterprise/32
           by Powersoft
       Version 5.0.04
  Copyright c 1991 - 1997 Sybase, Inc.
       and its subsidiaries.
.....
Does the string gets truncated when you run the app thru development environment as well? What operating system you are using?

Avatar of xo123

ASKER

For any objects longer than 32 KB,
the libaryexport() can only export them to 32 KB long.
But if I used the Library painter's Export option, it can export successfully without loss.

Here's my coding:
   ....
   String  ls_objsyn
   ls_objsyn = LibraryExport( lib_path,  obj_name, DirWindow! )
   ....

Avatar of xo123

ASKER

I'm using Window 2000 Professional.
Avatar of xo123

ASKER

Oh.... I just discover one thing:
  FileWrite can write only 32,766 bytes at a time, which includes the string   terminator character. If the length of variable exceeds 32,765, FileWrite writes the first 32,765 characters and returns 32,765.

I'm using FileWrite() for writing the export script.

What can I do?
Avatar of xo123

ASKER

I'll try to partition the export script (ls_objsyn) and write each partition at a time.
OK. Using filewrite you can only write 32k at a time. Try PFCs of_FileWrite. I think of_filewrite can handle more than 32K.
ASKER CERTIFIED SOLUTION
Avatar of namasi_navaretnam
namasi_navaretnam
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial