Features | Community | Download | Full Version

Username
Password


Forgot your Login?
Register Now...


Search in Forum

Search in FAQs

Find User

    

  Register now!

If you have received an Instant.EXE webcode enter it here.

Quickstart Workshop

This Workshop will teach you how to create a simple program - but not as simple as bringing up a "Hello World" message... You will learn to use variables, process user input and handle events. The script will prompt the user for a message via a standard input box. It will then display the message in a custom window which also contains a button that ends the script.



Grab a cup of coffee, fire up Instant.EXE and you're ready to go.

On the left you can see the list of commands that are available to create scipts. We will refer to this as the "command list". The big blank area is the "script area".


The first thing our new script should do is to open an input box and prompt the user for a message.

You don't have to create this window by yourself, since Instant.EXE provides several standard input boxes. Drag and drop the "input" command from the command list into the script area. A dialog will come up prompting you to set the element`s properties. The text the user enters is saved in a _variable_. Let's call ours [message]. You can add some custom text to the standard input box, i.e. to tell the user what to enter.



The rest of our script will be based on a custom window, which we will create in this step.

Drag the "Display window"-command into your script. Once again, a property dialog box will come up. Give your new window some descriptive title and set the size parameters. For our little script a width of 50 and a height of 25 will do. Activate the "Interior" option. This way we don't lose height for the title bar. Also set the "Activate" option to give focus to the new window when it comes up.



In the previos step we have created an empty window. Let's add some components.

The first action in our script is to prompt the user for some input. Of course we can use whatever he entered throughout the script, since it is saved in a _variable_. In our script, we will show the message using a _label_ component. Drag over the "Display control" command from the command-list. In the properties window select label and press the V button to bring up a list of variables that are available. Select the variable called [message], which contains the text the user entered.


A button to end the script would be nice. In this step, we will create one.

A button is just another window component, so drag over the "Display control" command once more. This time select button from the type list. Enter the text that is to be displayed in the "Text" field. We need to give the button an _ID_, so that the program can identify it. Try to use descriptive names, e.g. "exitbutton". You have now successfully added a button that does nothing. We will make it do something in step 7.



The window design is now completed. We should display it.

When all components are added we have to tell script what to do next, otherwise it will simply end. Since we want the window to sit there and wait for the user to press the "Exit" button, we have to tell script to do so by putting it into an _event-loop_. Drag over the "wait" command and select "infinite" from the options.




Until now pressing the exit button has absolutely no effect. Let's change that.

If you want a script to do something on a certain event, you have to tell it what to do in a _subroutine_. The only event our script is waiting for is the "Exit" button to be pressed.

To create a subroutine, drag over the "::" component from the command list. Select "Display_control_exitbutton" from the "Within context of script" list. This is the name of your subroutine and Instant.EXE will automatically execute it when the corresponding button is pressed. The next step is to tell the script what to do when calling the subroutine. Since we simply want the script to end, select the "Exit" command. Select "Exit Script" from the properties. Every subroutine has to begin with "::RoutineName" and end with the return statement. Drag it over. Your button now causes the script to end when pressed.


Don't grab another cup of coffee. Compiling scripts takes just a couple of seconds.

When compiling a script, you have two options. You can either compile it as a standalone .exe or link it to the Instant.EXE runtime environment. This option is set from the "File->Script properties..." menu. Linking the .exe file to the runtime environment reduces the size of the resulting file, but anybody who wants to run the program must have the Instant.EXE runtime environment installed. You are free to pass it on with your script and it is also available to download. Select "Create EXE file ..." from the "File" menu and save your .exe file.

This is it!


Feel free to download the ix2web Code of this tutorial below...

**iX2008DF 79547FMTAJ TWVzc2FnZT 1QbGVhc2Ug aW5wdXQgYW 55dGhpbmcg eW91IGxpa2 UuLi58fAkw DQozOQlNeS BmaXJzdCBT Y3JpcHR8Vy c1MCdIJzI1 J0NFCTANCj M4CUV4aXR8 SSdleGl0Yn V0dG9uJ1gn MCdZJzAnVy cyOCw1J0gn OSw1JwkwDQ ozOAlbTWVz c2FnZV18SS dMYWJlbDEn WCc1LDUnWS cxNCdXJzM5 LDUnSCc2J0 wJMA0KMzEJ RQkwDQoxOQ lpWF9EaXNw bGF5X0Nvbn Ryb2xfZXhp dGJ1dHRvbg kwDQo1CUMJ MA0KNDUJCT ANCg===*




         Contact | Copyright © 2006 XELERATE Software, Inc. All rights reserved.