第六章 ObjectScript - Routine示例
Routine示例
下面显示了一个名为 demoroutine 的示例例程,它是用 ObjectScript 编写的。它包含的过程与上一节示例类中所示的方法执行完全相同的操作。
; this is demoroutine
write "Use one of the following entry points:"
write !,"random"
write !,"input"
write !,"interesting"
quit
//this procedure can be called from outside the routine
random() public {
set rand=$RANDOM(10)+1 ; rand is an integer in the range 1-10
write "Your random number: "_rand
set name=$$getnumbername(rand)
write !


.png)
.png)

.png)
.png)




