X has the ability to pass variables between screens. (Classic does not)
To do this setup an application with two screens. Screen1 and Screen 2.
On Screen1, place a label and a button. Set the text of the button to Go To Screen2
On Screen2, place a label and a button; Set the text of the button to Get Screen1 Text.
Set your variable. I entered basic text saying Nothing Entered so we know what state the variable is in when it is presented.
You will see here that we set the variable to what was entered in the text box once the Button is clicked. we then move to Screen2.
Here we show a few more concepts.
- You see the variable from screen one is passed once we click the button. But we are calling a function.
A function allows us to group certain tasks together, and we can send information when we call a function for it to perform. Here we have said:
"When the button on Screen2 is clicked, please call the function named whatWasSaid and send the “Current Day of the Week” as the Extra Stuff information.
When the whatWasSaid function is called it takes the “Extra Stuff” (being the day of the week) and adds it to the variable from Screen1 (using the Join component)
To be able to add the Extra Stuff to a Function, use the little gear.
Drag the Input Name
Then rename the X by click and typing what you want. I put Extra Stuff
Cross Screen Variables, and a Function all at once.
Here is the project to play with.