Set Constants as Default Text using Inspector

I have labels in many windows that use my app name in the content of the text. Is there any way to set constants as part of the default text of a label or textfield using the property list inspector?

Thanks

[quote=160801:@Mark Scardingo]I have labels in many windows that use my app name in the content of the text. Is there any way to set constants as part of the default text of a label or textfield using the property list inspector?

Thanks[/quote]

If your string constant is called toto, enter #toto in the default value for the label in the inspector.

Thanks Michel. I should have mentioned that I did try that and it’s not working for me.

I have a global constant called kAppName. In the Text property of the label I have:

Welcome to #kAppName

When the window displays, it shows, “Welcome to #kAppName

[quote=160805:@Mark Scardingo]Thanks Michel. I should have mentioned that I did try that and it’s not working for me.

I have a global constant called kAppName. In the Text property of the label I have:

Welcome to #kAppName

When the window displays, it shows, “Welcome to #kAppName”[/quote]

Is it really global, or is it an App constant ? If the latter, you should enter it as #App.kAppName

Yes, it’s global.

I’m using 2014 R 2.1.

If I add a module to a project, then a constant to that module an make it global, then it is global. It works fine with #kAppName

if I add the constant to App and make it Public, it is not global. It works fine with #App.kAppName

Please post your project if it still did not work.

[quote=160805:@Mark Scardingo] have a global constant called kAppName. In the Text property of the label I have:

Welcome to #kAppName
When the window displays, it shows, “Welcome to #kAppName”[/quote]
You cannot embed the constant in other text like that. The property value can only be #kAppName.

You might need to set the text in the Open event handler for the Label. Or create a new constant that is #kWelcomeMessage = “Welcome to My App” and use #kWelcomeMessage for the property value.

Thanks Paul.