Project source filename store during building step

Dear all,

At the time of building the application, I would like to I get the filename of the project used (as string), and assign this value to a label object in Window1.
I can extract the filename during the building by using

Dim sb as String = ProjectShellPath 
Dim anArray() as string = sb.split("/")
Dim i as integer = anArray.lastIndex
Print(anArray(i))

But I could “transfer” this info into the “Window1.label1.text”?

I looked into: Obtain source filename?
But I cold not come up with a solution.

Is what I am asking possible? If yes, any suggestion is welcome !

Thanks

Luciano

dim CountSlashes as Integer = CountFields(ProjectShellPath, “/”)
dim ProjectName as string = NthField(ProjectShellPath, “/”, CountSlashes)
dim ProjectPath as String = Left(ProjectShellPath, Len(ProjectShellPath) - Len(ProjectName))

The way to get it onto a window is to use a Constant. If you were to put a constant on Window1 defined like this:

Private Constant kName as String = "Default Name"

Change the name of the Window in the inspector to: #kName

In your script you can set it with ConstantValue:

ConstantValue("Window1.kName") = "whatever the new name is"

I cannot change the constant name from “kName” into ‘#kName’.
How do I do that I get an error.
Thanks !

You cannot make your constant name #kName. It should stay as kName. When you assign it in code you also refer to it as kName. However, If you are using the inspector in the IDE then you need to use #kName so that it knows you are assigning a constant called kName and not just the fixed text kName.

I updated my post regarding that.

Sorry. I don’t get it.
How do I do this: “However, If you are using the inspector in the IDE then you need to use #kName so that it knows you are assigning a constant called kName and not just the fixed text kName.”

I think I got it.

Thanks !

Like this:

1 Like