HSP sun HSP Programming Guide

HSP Guide [8]

if

It does in the form of "if" (conditional expression). It comes to execute the following. It is equal (=) and no equal (!=).

	a=30-20

//	if 'a' is 10...
	if a=10{
		mes "equal!"
	}

//	if 'a' is NOT 10...
	if a!=10{
		mes "equal!"
	}

This concludes my report about less than and more than.

	a=10

	if a>10{
		mes "equal"
	}

	if a>=10{
		mes "equal"
	}

	if a<10{
		mes "equal"
	}

	if a<=10{
		mes "equal"
	}

And, another conditional expression is following.

	a=7

//	 if 'a' is NOT 0...
	if a {
		mes "!"
	}

	a=0
	if a {
		mes "?"
	}

When you combine two or more conditional expressions, and(&) and or(|).

	a=10
	b=1

	if a=10&b=0 {
		mes "?"
	}

	if a=9|b=1 {
		mes "!"
	}

< Prev | Next >

About

Welcome to HSP sun. Here is a site to introduces HSP, a free script language system.

Menu

Copyright(c) HSP sun [HSP]

inserted by FC2 system