How to use subroutines – IAI America XSEL-KE User Manual

Page 311

Advertising
background image

296

Appendix

14. How to Use Subroutines

Description

If the same processing is performed multiple times in one program, the applicable steps are grouped and
called together. This group of steps is called a subroutine. Subroutines are used to shorten program steps
and make programs easier to read. Up to 99 subroutines can be used in one program. Subroutine calls
can be nested by up to 15 times.

How to Use

Use the following commands to declare/call subroutines:
EXSR Call

subroutine

BGSR

Declare start of subroutine (declare start of group of steps)

EDSR

Declare end of subroutine (declare end of group of steps)

Example of Use

Note

Jumping out of a subroutine to a TAG outside the subroutine using a GOTO command is prohibited.

Consolidate the same tasks into
one location.

Subroutine

Advertising
This manual is related to the following products: