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!

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2024 18:59 PM UTC
  2. Beta Testing
  3. # 1

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.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2024 19:49 PM UTC
  2. Beta Testing
  3. # 2

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. Peter Pang @Appeon
  2. Tuesday, 26 November 2024 02:57 AM UTC
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
  1. Helpful
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.
Peter Pang @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 30 October 2024 02:20 AM UTC
  2. Beta Testing
  3. # 4

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.
  • Page :
  • 1


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