anyone know how to access the project name and version number from code?

Hi. I would like to access the actual SC project name and the version number (like 1.1.0) that come form the project settings. I would like to access them as some sort of global variables, for use in my code as well as titles in apps, etc.

Anyone know how to get to that, if it is possible?

Also, I noticed when you increment the version number for a project it has 2 digits, but the version number listed elsewhere has three decimals places (1.1.0). How does this work?

Thanks,
Jamie

Re: anyone know how to access the project name and version number from code?

Hello,
as far as I know, it’s not possible because this is not stored in a variable…
But of course you can create a session variable for your own purpose…

Best regards
Uwe

Re: anyone know how to access the project name and version number from code?

Thanks - I will add this to the feature suggestion. It would be useful to know what version of the SC and what version of your project created a particular deployed installation. If I create my own session variables it is just one more thing I will probably forget to update :wink:
Thanks for your input - Peace,
Jamie

Hi Onmountain,
You can get the project name and project version in scriptcase. Please follow these steps:

[SIZE=4]Example to get Project Name and Version[/SIZE]
Lets suppose that your application name is ‘blank1’.

$app = new blank1_ini();  
$app->init();

echo 'Project Version:'.$app->nm_app_version; 
echo 'Project Name:'.$app->nm_grupo;

Note: Now lets suppose that your application name is form1 then your first line will be like this: $app = new form1_ini(); . As you can see only need to replace with your application name and add ‘_ini();’

Cool. Do I put that code in a certain event or will it work anywhere? Thanks!!! I will use this, as I can then display the version in the footer or an ‘about software’ menu item.
You are great!

Has anybody succeed to implement this ?
I’m having problem getting it into the App header

hirambq - could you please give us more details ?

Arthur

I’ve been doing this and it works well. But you need to enter the name of the app this routing is working in and add the _ini to it. Just cut and paste won’t work.

I’m still confused. I want to display the Project Version in a header to the TreeMenu App. There is a question above asking where to put this code (which hasn’t been answered).

There are also some vriables which are used throughout SC but are not explained anywhere :frowning:
For example I have found several places showing some vars like: .$app
those show up in the security generated module but I was not able to find any help or description on what it is and how to use it ?

BTW. Is there any place with some reference to coding ? I think at this moment if someone who has never done any programing in the past and want to even use simple structure I …THEN…ELSE would be confused, because I find no documentation on coding at all (other than SC marcos list).

Arthur

so where do you place this code ???

On applicationinit or scriptinit. You are just reading the ini file, so I guess it doesn’t matter as long it’s before you display your data.

ok, here it gets a bit complicated. I would like to place a version number on the main menu (which is TreeMenu in my case), but before the user gets to it there is a Login App first to grant an access. Would I use the code in a Menu or in a Login App ?
The best scenario for me would be to store the version umber in global Var, so then I can use it anywhere, anytime

Arthur

Simple.

In the onApplicationInit event of your login app, add the following line:

[version] = $this->nm_app_version;

Make sure that you set the Application->Global Variable entry for “version” to Session and Out.

Now you can use [version] in any app’s header, etc.