1. ma jack
  2. PowerBuilder
  3. Tuesday, 19 December 2023 06:21 AM UTC

Hello everyone !
I have defined a string variable and assigned it the value of today's date. However, the actual result is the compilation time of the exe, not the current date.


i'm not sure if this is a PB bug. The following is my test code, and you can observe this phenomenon by running the attached exe directly.

string ls1 = string(today(), "yyyymmdd")
string ls2
ls2 = string(today(), "yyyymmdd")
sle_1.text = ls1
sle_2.text = ls2


if this is a known issue, what is the cause? i am using PB version 2019R3 2781.

Attachments (1)
Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 19 December 2023 07:05 AM UTC
  2. PowerBuilder
  3. # 1

Hi.

2781 isn't an "official" release of PB 2019 R3.

Have you tried your code to any of the releases mentioned above?

Andreas.

Comment
  1. ma jack
  2. Tuesday, 19 December 2023 07:17 AM UTC
thank you andreas, i only have this version of PB, so I only confirmed it in this version
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 19 December 2023 06:57 AM UTC
  2. PowerBuilder
  3. # 2

This is expected. The initialization part of the variable declaration is performed at compile time, not when the app executes.

Comment
  1. Miguel Leeuwe
  2. Tuesday, 19 December 2023 08:38 AM UTC
Whilst Appeon calls this to be a "feature", I call it an anomaily. Not a single programming langues that I know of does this. I can be useful though. I use it to set the app's compilation dates, but still.. this is not normal behaviour in my humble opinion.
  1. Helpful 1
  1. Arnd Schmidt
  2. Tuesday, 19 December 2023 19:30 PM UTC
.. and I am still stepping into this anomaly from time to time.

Especially when I have been coding in other languages.

sigh ;-)
  1. Helpful 1
  1. John Raghanti
  2. Wednesday, 20 December 2023 12:13 PM UTC
We use that feature actively in our software. Our clients do a lot of electronic data interchange with third parties. We use this in one of the elements so that if there's a problem we can determine exactly what version of our software created the messages. It is super helpful in cases like this.
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.