1. Chris Rowe
  2. PowerServer 2020 or older (Obsolete)
  3. Wednesday, 3 August 2022 17:43 PM UTC

For reference, we're currently on PB17 R3, PowerServer 2020*.

I'm trying to have a static textbox that displays the most recent build/deploy date of our application in the TEST environment. I've searched around and what little resources I can find recommend using a constant instance variable in an object. I tried this, but the variable is still updated every time the web app is refreshed. Am I spinning my wheels on something that ultimately isn't possible, or am I just missing something?

Any insight would be greatly appreciated!

 

*edit -- Added PowerServer tag for clarity, sorry for the confusion!

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 3 August 2022 20:20 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

if you declare your instance variable like this:

string is_date = string(today(), 'dd-mmm-yyyy')

then the value of is_date will only be updated when the script is compiled. If you assigned the value and you don't compile, then tomorrow will show yesterday's date.

Not sure if that could be of any user to you.

regards,

Comment
  1. Chris Rowe
  2. Thursday, 4 August 2022 13:54 PM UTC
Declaring it as a constant was the second approach I took and it still ended up being updated every time the app was loaded, unfortunately.
  1. Helpful
  1. Andreas Mykonios
  2. Thursday, 4 August 2022 13:55 PM UTC
I see you mention in a later post that this is a web application (PowerServer). I don't believe that any of this will work, because your code is transpiled to javascript (I believe). During this conversion your variable will work differently...

Andreas.
  1. Helpful 1
  1. Chris Pollach @Appeon
  2. Thursday, 4 August 2022 14:08 PM UTC
Correct
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Wednesday, 3 August 2022 19:05 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

" the web app is refreshed."

 

is this a powerServer application? 

 

Comment
  1. Chris Rowe
  2. Thursday, 4 August 2022 13:26 PM UTC
Forgive me since I'm still learning the nomenclature, but it's a PowerBuilder application that is being utilized as a web app via PowerServer and/or the IWARunner. Very good chance that I'm messing up some of the terminology but the application itself is developed and built in PowerBuilder before being deployed.
  1. Helpful
  1. mike S
  2. Thursday, 4 August 2022 14:17 PM UTC
Old versions of powerserver applications are not 100% the same as the powerbuilder application it was generated from. What you are trying to do probably won't work in old powerserver versions (2020 and prior)



you need to specify the version of powerserver - PS 2021 is a completely new product
  1. Helpful 1
  1. Chris Rowe
  2. Thursday, 4 August 2022 14:25 PM UTC
It is indeed PowerServer 2020, which likely explains it. Appreciate the clarification.
  1. Helpful
There are no comments made yet.
Mark Montgomery Accepted Answer Pending Moderation
  1. Wednesday, 3 August 2022 18:59 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3

Not sure if this is exactly what you're looking for, but it's what I use for this type of info.  It's extracting info from the project object (this only gets data specifically from the Version tab):

long ll_pos, ll_pos2
string ls_project, ls_copyright, ls_product, ls_file

// Export project info into string.
ls_project = LibraryExport('pblwithproject.pbl','projectname', ExportProject!)

// Get copyright.
ll_pos = Pos(ls_project, 'CPY:')
ll_pos2 = Pos(ls_project, '~r', ll_pos)

ls_copyright = Mid(ls_project, ll_pos + 4, ll_pos2 - (ll_pos + 4))

// Get product version.
ll_pos = Pos(ls_project, 'PVS:')
ll_pos2 = Pos(ls_project, '~r', ll_pos)

ls_product = Mid(ls_project, ll_pos + 4, ll_pos2 - (ll_pos + 4))

// Get file version.
ll_pos = Pos(ls_project, 'FVS:')
ll_pos2 = Pos(ls_project, '~r', ll_pos)

ls_file = Mid(ls_project, ll_pos + 4, ll_pos2 - (ll_pos + 4))

 

HTH...

Mark

Comment
  1. Chris Rowe
  2. Thursday, 4 August 2022 13:27 PM UTC
Not exactly what I'm looking for, but still very helpful nonetheless--can always go with something like this as a backup plan. I appreciate the response Mark!
  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.