LOTUSSCRIPT 言語


戻り値
C 関数のデータ型は、Declare ステートメントの明示的なデータ型宣言、関数名のデータ型を示す接尾辞、または適用できる DEFtype ステートメントによって決定されます。この 3 つの方法のいずれか 1 つを使用する必要があります。いずれの方法も使用しない場合、戻り値のデータ型は既定で Variant 型になり、C 関数では不正になります。
LotusScript データ型C 関数の型として正当かどうかC データ型
Boolean 型[はい]bool 型
Byte 型[はい]byte 型
Integer 型[はい]int 型
Long 型[はい]long 型
Single 型[はい]float 型
Double 型[はい]double 型
Currency 型[いいえ]
String 型正当、ただし固定長文字列を除くchar * 型または char[] 型
Variant 型[いいえ]
製品固有のオブジェクト正当 (Long 型の 4 バイトのオブジェクトハンドルとして)詳しくは、LSX ツールキットを参照
ユーザー定義オブジェクト[はい]詳しくは、LSX ツールキットを参照
型のインスタンス[いいえ]
Any 型[いいえ]
配列[いいえ]
リスト[いいえ]
次の例では Windows 3.1 の API 関数を使用します。ユーザーは作業するウィンドウを識別します。スクリプトはウィンドウを見つけ、ウィンドウテキストをリセットし、ユーザーがそのウィンドウにフォーカスを保っているかぎり制御を渡します。ユーザーがフォーカスをウィンドウの外へ移すと、スクリプトは元のウィンドウテキストを保存してメッセージを表示します。存在しないウィンドウか実行中でないウィンドウをユーザーが要求した場合も、スクリプトは適切なメッセージを表示します。

すべての宣言はモジュールレベルです。

' Gets the handle of the active window.
Declare Function GetActiveWindow Lib "User32" () As Long

' Gets the handle of the next window.
Declare Function GetNextWindow Lib "User32" _
                   (ByVal hwnd As Long, _
                   ByVal uFlag As Long)
                   As Long
' Windows constant for uFlag parameter:return the handle
' of the next(not the previous) window in the window
' manager's list.
Const GW_HWNDNEXT =2

' Makes a window (identified by its handle) the active window.
Declare Sub SetActiveWindow Lib "User32" (ByVal hwnd As Long)

' Gets the text in the window title bar.
Declare Function GetWindowText Lib "User32" Alias "GetWindowTextA" _
                   (ByVal hwnd As Long, _
                   ByVal lpString As String,_
                   ByVal chMax As Long) As Long

' Sets the text in the window title bar.
Declare Sub SetWindowText Lib "User32" Alias "SetWindowTextA" _
                   (ByVal hwnd As Long, _
                   ByVal lpString$)

関連項目