1. Patrice Domange
  2. PowerBuilder
  3. Wednesday, 13 April 2022 13:10 PM UTC

Hello,

In the past days, I was using the fact that the compiler was resolving variables at compile time of the object.

So when I was declaring an instance variable like this :

string is_CompilationDate = String( today(), 'dd/mm/yyy' )

When making a full build of the application, the is_CompilationDate variable had is value set permanently to the date I last full build the application.
Now, it seems that from PB2017 until PB2021, the behaviour of the compiler as changed because everyday I start the application, the compilation date indicates the actual date, instead of real compilation date !

Quid ?

How can I achieve this now ?

 

John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 13 April 2022 16:41 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Patrice - 

I've done this in a very similar manner, except I include the keyword "Constant".

I don't currently have access to PB 2021 to verify, but I have verified this works in 2019 R3.

HTH, John

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 13 April 2022 17:33 PM UTC
  2. PowerBuilder
  3. # 2

Have a global or instance variable:

DateTime dtCompileDate = Today()

 

When the object is compiled, the compiled code has the current date hard coded.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 13 April 2022 17:51 PM UTC
  2. PowerBuilder
  3. # 3

Hi Patrice;

   Here is what I use in my STD framework. This works perfectly in all Appeon PB versions, as follows:

// Compile Constants
Constant     Date      id_compiled    = Today ( )        // Date last Compiled
Constant     Time      it_compiled    =  Now ( )         // Time last Compiled

HTH

Regards ... Chris

Comment
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Thursday, 14 April 2022 07:05 AM UTC
  2. PowerBuilder
  3. # 4

Hi Patrice,

I did many kinds of verifications in PB 2017 and PB 2021 but didn’t reproduce the issue you described. If the issue persists, I suggest you submit a bug to our support system https://www.appeon.com/standardsupport/newbug and provide an example case there for us.

Regards,
Ken

Comment
There are no comments made yet.
Patrice Domange Accepted Answer Pending Moderation
  1. Thursday, 14 April 2022 11:25 AM UTC
  2. PowerBuilder
  3. # 5

Thanks to all for your help !

I will adapt my code as described.

 

Comment
There are no comments made yet.
Roland Gallinera Accepted Answer Pending Moderation
  1. Friday, 12 January 2024 19:40 PM UTC
  2. PowerBuilder
  3. # 6

I have two versions of an app that I am currently trying to add the compilation date, the first app is a basic Powerbuilder app and I have this in my global variables:

constant string gv_string_compile =String(Today(), "mmm dd, yyyy h:mm AM/PM")

 

This works fine and the actual compile date always shows up in the about window for the app.

 

But the same code in a Winform app, will always generate the actual date rather than the compile date... any work arounds?

Comment
  1. Roland Smith
  2. Tuesday, 16 January 2024 21:18 PM UTC
Winform App? PowerBuilder doesn't create Winform apps. Please elaborate.
  1. Helpful
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.