EasyManuals Logo

Kollmorgen AKD Basic User Manual

Kollmorgen AKD Basic
506 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #116 background imageLoading...
Page #116 background image
AKD BASIC User Guide | 6 AKD BASIC Parameters, Operators, Statements
6.1.18 Static
General Information
Type Statement
Description
The Static statement is used in a Function, Sub or Interrupt to specify that the
specified variable's value be remembered even when the Function or Sub is fin-
ished.
Units N/A
Range N/A
Default
Value
N/A
Data Type N/A
Start Ver-
sion
TBD
Description
The Static statement is used in a Function, Sub or Interrupt to specify that the specified var-
iable's value be remembered even when the Function or Sub is finished. The next time that the
Function, Sub or Interrupt is executed, the value will be available.
Example
This example illustrates the difference between using Dim and Static in a Sub procedure. 'x'
always gets reset to zero, while 'y' continually gets incremented.
Main
while 1
call MySub
pause(1)
wend
End Main
Sub MySub
dim x as integer 'value is forgotten
static y as integer 'value is remem-
bered
x = x + 1
y = y + 1
print x,y
End Sub
Related Topics
Dim | Sub...End Sub | Function | Interrupt...End Interrupt
Kollmorgenâ„¢ | March 30, 2012 116

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Kollmorgen AKD Basic and is the answer not in the manual?

Kollmorgen AKD Basic Specifications

General IconGeneral
BrandKollmorgen
ModelAKD Basic
CategoryController
LanguageEnglish

Related product manuals