Start!

Step1

Step2

Step3

Step4

Step5

Step6

Step7

Step8

Final

Special thanks

Cover


step4: Let's issue a command

Let's take a look at the super-easy script I wrote earlier.

picload "HSP3TTL.JPG"


Can you vaguely imagine that the first line means to display the image file ?? In HSP, the statement using words like this is written in the script, and it is processed in order from the first line. It is supposed to be done. For example,

picload "HSP3TTL.JPG"
picload "ABC.BMP"


If you write two lines like this, the first line will be executed and then the second line will be executed. The second line reads the image file "ABC.BMP". (In this case, the file with this name must be in "My Documents")
Words that describe work such as "picload" are called "instructions" or "statements." Also, the part of "" HSP3TTL.JPG "" used together with the instruction is called a parameter. The second line "stop" is also one of the instructions. Organizing it,



Statement

Parameters

Meaning

picload

File name

Display image file


It looks like

. In other words, the command "picload" gives an instruction to "display the image file", and the parameter "" HSP3TTL.JPG "" becomes the file name. HSP has instructions with various functions. Most of them are designed so that you can specify them in detail by writing numerical values or letters in the parameters. In HSP,


    Specify the content of the work to be performed with the
  1. command + parameter There must be a space between the
  2. instruction and the parameter.


Remember that. Don't forget to leave one or more spaces between the instructions and the parameters.

picload "HSP3TTL.JPG"

Is correct, but

pic load "HSP3TTL.JPG"
picload"HSP3TTL.JPG"


Writing like this is not good. I get an error.

But that's not fun, so let's write a script with a lot more different instructions. Well then,



Statement

Parameters

Meaning

cls

Numbers from 0 to 4

Clear the screen

mes

String

Display message



Let's use the command. The command "cls" clears and cleans what is displayed on the screen. By specifying a numerical value from 0 to 4 in the parameter, you can specify the color to clear. 0 is white, 4 is black, and so on. "Mes" is an instruction to display the character string specified by the parameter on the screen. Let's write a script like this using these.

cls 0
mes "Hello, this is HSP."
mes "End"


In the HSP Script Editor, select "New" from the "File" menu to start writing from scratch. Don't hesitate to delete the two-line script you wrote earlier and start writing a new one. Once you've entered the script, press F5 to run it.

Hello, this is HSP.
The end


Did the message appear on the screen ?? If you don't see it, there must be a typo somewhere. If you come out, try modifying it a little and try it further.
You can also try setting the parameter of the "cls" instruction to 1 or changing the character string displayed by the "mes" instruction. As with the "picload" command above, when you specify a character string or file name as a parameter, you must enclose both ends with "" (double quotation marks). This is also an HSP rule, so don't forget.

Can you somehow see what the script looks like? But it's just the beginning, it's time to go.

ONION software Copyright 1997-2009(c) All rights reserved.