SetLibraryList max length at Powerbuilder 10.5



When I used SetLibraryList(string[500]) and AddToLibraryList(), the program can run.

But I used SetLibraryList() and string array length more than 500, the program auto shutdown.


The string array more than 500 can't run ?


PowerBuilder 10.5.1 Build 6662

8.0 PFC Utility services

Question Tags: 


Michael Kramer answered SetLibraryList max length at Powerbuilder 10.5


Hi Li Mei,

I did some testing using PB 2017 R2, build 1756 gradually extending the length of LibraryList string. I found the issue still exists.

Chars of newList Files in newList SetLibraryList( newList )
9456 499 OK
9467 500 App crash
19380 499 OK
19419 500 App crash
19458 501 App crash

When the application crashes, it crashes silently. Neither Application.Close nor Application.SystemError executes.

Question remains: How many files does anyone need in the LibraryList in case 500 files is too few? ...


Actually, my library list only contains 5 different file names, I just repeat one of the files again and again.

HTH /Michael

Armeen Mazda's picture

Hi Michael, Can you open a support ticket for your findings:  Sounds like PowerBuilder might have a hard-limit of 500 and so we may need to document this and/or modify the product itself to restrict this.

Michael Kramer's picture

Hi Armeen, I created ticket #765 and attached my demo app..


Armeen Mazda answered SetLibraryList max length at Powerbuilder 10.5


Please download a trial version of PowerBuilder 2017 R2 and see if you can replicate the same problem:

If you can replicate the problem with the 2017 R2 version then please open a support ticket and submit a test case:

We will do our best to address as many bugs as possible in 2017 R3 and future releases.

Olan Knight answered SetLibraryList max length at Powerbuilder 10.5


I have never specified SetLibraryList () with an array variable definition, and I've used this function quite often.

I have always built a string with the PBLS required, then specified that one string as the parameter to the function.

Example:   ls_libraries = "library1.pbl, library2.pbl, library2.pbl, .....libraryN.pbl"

        OR    ls_libraries = getlibrarylist ()
                 ls_libraries =ls_libraries + "library1.pbl, library2.pbl, .....libraryN.pbl

       THEN   SetLibraryList (ls_libraries)

With this technique, I've never reached any size limitation of the function.


Try your code in this manner:

Create your array as usual
Create a master string to hold the final library list: ls_libraries
Populate your array
Using the TRIM function, copy the data from the array into the string "ls_libraries"
Use the string "ls_libraries" as the parameter to the SetLibraryList() function ---> SetLibraryList (ls_libraries)