What's wrong with my IDE script ?

Hey guys, can you help me…?

I basically want Compile my app with the name ‘Lite’ and then change the app constant ‘Lite’ to FALSE to compile again with the name ‘PRO’.

Xojo does the compiling two times… but neither the name of the app nor the constant value change…

[code]dim AppPath as string
BuildWin32 = True
PropertyValue(“App.WindowsAppName”) = “LITE”
ConstantValue(“App.Lite”) = “true”

AppPath = BuildApp(3,False)
PropertyValue(“App.WindowsAppName”) = “PRO”
ConstantValue(“App.Lite”) = “false”
AppPath = BuildApp(3,False)[/code]

Where are you running this script from?

The reason I ask is that you can’t call BuildApp from a BuildStep script.

Hey Greg… I am running it from the IDE script window…

Just run the part up to (but not including) the BuildApp call

dim AppPath as string
  BuildWin32 = True
  PropertyValue("App.WindowsAppName") = "LITE"
  ConstantValue("App.Lite") = "true"

Then check the values in the project itself

Hey Norman… I tried your suggestion… and nothing happened… No value changed… What am I doing wrong ?

Recording also does not work… No matter what I do in the IDE the only event that gets recorded is

SelectWindow “IDE Script - [Untitled *]”

Which seems to be the event that corresponds to me clicking in the “stop recording” button… right ?

By the way I am using 2016 r3

No idea since this works just as I expect in 2017r1.1
I created a new desktop project
Added a boolean constant “lite” to the App instance
On Window1 I put a label that has in its open event

If app.Lite Then
  Me.Text = "lite"
Else
  Me.Text = "pro"
End If

Created a new IDE script using File > New IDE Script
Pasted your original code in
Ran that script

I get a LITE.exe built and a PRO.exe built
And when I run those apps they properly report as lite and pro as I expect

Ill try in 2017 r1.1 and let you know how it goes…

OK, it’s something related to MY project… as if I try it with a NEW project it works as expected… so… Where could I start looking to find the problem ?

What happens is that in this particular project constant values don’t chane with the IDE script…

Hard to say

  1. your app instance isn’t named “App”
  2. you have an ide script as part of your project (which is not the same as running it from the IDE script window)
  3. lord knows and without seeing something like a screen shot of your project & script together to base a guess on its hard to say

Alllllllllllriiiiight…

-----> your app instance isn’t named “App”

Norman you are da man!

The common confusion is because at runtime you can get a reference to the Application subclass using “App”
BUT - at runtime App is a METHOD that returns the singleton that is created from whatever your project Application subclass was called

By default a new project creates the subclass named “App” - which leads to this lack of clarity

Folks get confused between the runtime name and project item name