1. John Fauss
  2. Beta Testing
  3. Tuesday, 29 October 2024 16:29 PM UTC

Since the LibraryDirectory/LibraryDirectoryEx PowerScript functions have been neutered when an app is executing from the IDE in solution form, how can an app recognize when it is running as a PB solution?

I have a multi-threaded data retrieval example app in CodeXchange that lists in a DDDW the DataWindows in a PBL. I'd like to refactor this so that the functionality works when the app is in solution form, but am unsure how to proceed.

I would appreciate any ideas. Thanks!

Accepted Answer
Peter Pang @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 27 November 2024 04:11 AM UTC
  2. Beta Testing
  3. # Permalink
Hi John, We have prepared an offline installation version for you PB2025 build 3484. We adapted some Library functions. In addition, the function IsRunningAsSolution is provided to determine whether PB IDE is running under solution. Please download and install it to verify the issue you reported and let us know if any problems. PowerBuilder Download Link: https://file.appeon.com/download/APB/2025/R1/OneOff/build_3484.00/OneOff-PB2025R1-3484.zip SHA256 Hash of OneOff-PB2025R1-3484.zip: https://file.appeon.com/download/APB/2025/R1/OneOff/build_3484.00/SHA256/OneOff-PB2025R1-3484.txt Regards, Peter
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 26 November 2024 17:30 PM UTC
  2. Beta Testing
  3. # 1

Hi John;

  FYI: The Engineering team is adding a new IsRunningAsSolution method that should be available in the next beta build.

Regards .. Chris

Comment
  1. John Fauss
  2. Tuesday, 26 November 2024 19:22 PM UTC
Yes, Peter has provided a one-off build that includes this new function as well as LibraryDirectory and LibraryDirectoryEx functions that work in a Solution (see his response to an earlier post in this same thread, below), and I tested it this morning. It works great and will be a BIG help to developers!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 26 November 2024 19:43 PM UTC
Awesome John! :-)
  1. Helpful
There are no comments made yet.
Peter Pang @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 30 October 2024 02:20 AM UTC
  2. Beta Testing
  3. # 2

Hi John,

Thanks for your suggestion. I will pass your suggestion on to the development team for evaluation.
In addition, I recommend you open a support ticket to track progress: https://www.appeon.com/standardsupport/newbug

Best Regards,
Peter

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2024 20:53 PM UTC
  2. Beta Testing
  3. # 3

I have a solution running with a PBD in the library list so I imagine a PBL would work. The question I have is whether we can still update the library list at EXE runtime to add PBL files created in InfoMaker.

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2024 19:49 PM UTC
  2. Beta Testing
  3. # 4

I'm considering creating a non-visual object that contains a "is running as solution" function and a wrapper for the LibraryDirectory function.

The IsRunningAsSolution" function will perform these steps:

  1. Check the handle of the Application object and return False if it is non-zero. This means the app is NOT running from the IDE, so the LibraryDirectory method will work since the PB objects are packaged into PBD's or DLL's.
  2. Issue GetLibraryList() to obtain the list of pbl's (for a workspace) or folders (for a solution).
  3. See if the first (possibly, the only?) "library" file exists. A solution will list the directories as full paths created when the workspace migration to a solution was performed or a new solution is created. These folder names all end with ".pbl". A FileExists call will return True only if the .pbl file exists and False if only the solution folder exists.

Preliminary testing indicates this may be a viable approach.

The LibraryDirectory "wrapper" function will first use the IsRunningAsSolution function. If the PBL's (or deployed .pbd's or .dll's) are available, the PowerScript function is called and the results passed back to the caller. If the PBL's are not available, a search of the files within the "library" directory will be performed against the object type argument as if the PowerScript function was used.

Comment
  1. John Fauss
  2. Tuesday, 26 November 2024 17:00 PM UTC
The new IsRunningAsSolution() PowerScript function provided in the one-off Build 3484 works as expected in my (limited, so far) testing. The GetLibraryList() function was previously working in the earlier Build and continues to work successfully. The LibraryDirectory and LibraryDirectoryEx functions now return information about objects in Solution folders and in Workspace PBL's. As expected, the comments field in each line of the response from the LibraryDirectorEx function is empty, since this piece of information is not included in the Solution Migration process.

MANY THANKS AND MUCH APPRECIATION to you and the entire development team for these important improvements to the PB 2025 product!!!

Just curious: Were any other library-related functions restored in this Build? I've not yet had an opportunity to test.
  1. Helpful
  1. Peter Pang @Appeon
  2. Wednesday, 27 November 2024 02:03 AM UTC
Hi John,

Thank you very much for your response!



Were any other library-related functions restored in this Build?

Answer: We are working on restoring them, but some of them still have problems. We are not sure whether some scenarios are necessary, such as whether librarydirectory supports pbl solution dirs which aren't in the library list.



Regards,

Peter
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2024 18:59 PM UTC
  2. Beta Testing
  3. # 5

Hi John;

  That is an excellent question! I was just thinking about that aspect myself last night for my STD Framework. At the moment though, I have no solution for you. I can still see the EXE vs IDE execution switch still - just not the execution environment (WS vs SOL) state it came from ...

 

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.