
Description
Returns OS environmental variable specified by argument

Syntax
ret = getenv(string)

Parameters
| string | : | Environment variable name |

Return Value
| NULL | : | Error or environment variable | |
| string | : | Environment variable | |

System Return Value
ERROR
| 0 | | Success |
| 1 | | Argument error |
| 8 | | GETENV error |

Example
//[result example]
//
//OS=Windows_NT
//
run()
exit
function run()
print('OS=${getenv("OS")}')
endfunction

Description
(Parases and) Returns the argument specified at command line
If the number of arguments specified, the value of argument will be stored sequentially as array variable
When there is no argument, a prompt will appear. The input character will be retunred.

Syntax
ret = getopt(string,{ … })

Parameters
| string | : | Prompt for asking the user to input Default: 'ARG[n]=' (n represents the number of times the user inputs) |
| { … } | : | multiple strings can be specified. |

Return Value
| NULL | : | Error or character string passed by the user | |
| string | : | Character string passed by the user | |

System Return Value
ERROR
| 0 | | Success |
| 2 | | Output error |
| 3 | | Input error |

Example
//[result example]
//
// input word[1]: h
// input word[2]: e
// input word[3]: l
// input word[4]: l
// input word[5]: o
// input word[6]:
// input word[7]: w
// input word[8]: o
// input word[9]: r
// input word[10]: l
// input word[11]: d
// input word[12]: exit
// input word is hello world
//
exit input_stdin()
function input_stdin()
local i
local input = ''
local word = ''
loop i=1; ; i++
input = getopt('input word[${i}]: ')
if input eq 'q'
print( "input word is ${word}" )
break
else
word = word & input
endif
endloop
endfunction

Description
Sets the environmental variable specified by argument

Syntax
ret = setenv(string1,string2)

Parameters
| string1 | : | Environment variable name |
| string2 | : | setting value |

Return Value

System Return Value

Example
//[result example]
//
//ABC=sample
//
run()
exit
function run()
setenv('ABC', 'sample')
print('ABC=${getenv("ABC")}')
endfunction

Description
Suspend the execution of program for specified period (second)

Syntax
ret = sleep(sec)

Parameters

Return Value

System Return Value

Example
//[result example]
//
//input suspend time(sec): 30
//now suspending...
//30 seconds suspended.
//
sleeptime()
exit
function sleeptime()
local input_time = 10
input_time = getopt('input susptend time(sec): ')
print('now suspending...')
sleep(input_time)
print('${input_time} seconds susptended.')
endfunction

Description
Measures the execution time of process(program)
Returns the time in acutual number for each argument (second)

Syntax
ret = systemtime(sys,user,rtime)

Parameters
| sys | : | CPU time executed in privilege mode |
| user | : | CPU time executed in user mode |
| rtime | : | Time required for execution |

Return Value

System Return Value

Example
//[result example]
//
// ....0
// ....1
// ....2
// ....3
// ....4
// ....5
// ....6
// ....7
// ....8
// ....9
// sys=0.000000 : user=0.000000 : rtime=10.024000
//
run()
exit
function run()
local t_sys, t_user, t_rtime, j
loop j=0; j<10; j++
print('....${j}')
sleep(1)
endloop
systemtime(t_sys, t_user, t_rtime)
print('sys=${t_sys} : user=${t_user} : rtime=${t_rtime}')
endfunction