{ } でオブジェクトへアクセス後にクラスに BraceEnd() メソッドがあれは BraceEnd() メソッドを実行します!
TimeForFun = new journey
# あっと驚く!
TimeForFun {
Hello it is me # なんと美しいプログラミングの世界でしょう!
}
# クラス本体
class journey
hello=0 it=0 is=0 me=0
func GetHello
See "Hello" + nl
func braceEnd
See "Goodbye!" + nl
Eval() 関数は文字列に記述されたコードを実行します。
cCode = "See 'Code that will be executed later!' "
Eval(cCode) # コードを実行してメッセージを表示します
リストの作成後にリストから実行用のコードを生成します。
aWords = ["hello","it","is","me"]
for word in aWords cCode=word+"=0" eval(cCode) next
Read(cFileName) 関数はテキストファイルを読み取ります。
また、 Write(cFileName,cString) 関数はファイルへ書き込みます。
see "Enter File Name:" give cFileName see read(cFileName) # ファイルの内容を表示
この用例は二つの命令を定義するクラスの作成方法です。
最初の命令は : I want window
次の命令は : Window title = <式>
‘the’ などのキーワードは無視されます。
new App
{
I want window
The window title = "hello world"
}
class App
# I want window 命令の属性
i want window
nIwantwindow = 0
# Window title 命令の属性
# ここでは window 属性を再定義しません
title
nWindowTitle = 0
# 値を与えると、キーワードは無視されます
the=0
func geti
if nIwantwindow = 0
nIwantwindow++
ok
func getwant
if nIwantwindow = 1
nIwantwindow++
ok
func getwindow
if nIwantwindow = 2
nIwantwindow= 0
see "Instruction : I want window" + nl
ok
if nWindowTitle = 0
nWindowTitle++
ok
func settitle cValue
if nWindowTitle = 1
nWindowTitle=0
see "Instruction : Window Title = " + cValue + nl
ok
前述の用例を完了するには read() でファイルの内容を取得します。
I want window
The window title = "hello world"
そして eval() でファイルの内容を実行します!
また、 GUI ライブラリでウィンドウを作成するために GetWindow() と SetTitle() メソッドを更新します。