Lessons VI : 3.7. Hàm

3.7. Hàm

Hàm trong AutoIt được định nghĩa bằng cách dùng khối Func…EndFunc:

Code:

Func MyDouble($value)

$value = $value * 2

Return $value

EndFunc

Sử dụng hàm cũng rất đơn giản:

Code:

$val = 10

For $i = 1 To 10

$doubled = MyDouble($val)

MsgBox(0, “”, $val & ” doubled is ” & $doubled)

$val = $doubled

Next

Identical(UDS)

 

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: