ライブラリー・パーツは EGL ファイルで宣言します。これについては、『EGL ソース形式』で説明しています。
Library CustomerLib3 // Use declarations Use StatusLib; // Data Declarations exceptionId ExceptionId ; // Retrieve one customer for an email // In: customer, with emailAddress set // Out: customer, status Function getCustomerByEmail ( customer CustomerForEmail, status int ) status = StatusLib.success; try get customer ; onException exceptionId = "getCustomerByEmail" ; status = sqlCode ; end commit(); end // Retrieve one customer for a customer ID // In: customer, with customer ID set // Out: customer, status Function getCustomerByCustomerId ( customer Customer, status int ) status = StatusLib.success; try get customer ; onException exceptionId = "getCustomerByCusomerId" ; status = sqlCode ; end commit(); end // Retrieve multiple customers for an email // In: startId // Out: customers, status Function getCustomersByCustomerId ( startId CustomerId, customers Customer[], status int ) status = StatusLib.success; try get customers usingKeys startId ; onException exceptionId = "getCustomerForEmail" ; status = sqlCode ; end commit(); end end
ライブラリー・パーツのダイアグラムは、次のとおりです。
その他の規則については、『命名規則』を参照してください。
このライブラリーは、デフォルトでは basicLibrary 型です。
すべてオプションです。
Record aRecordPart type basicRecord 10 myItem01 CHAR(5); 10 myItem02 CHAR(5); end
myRecord aRecordPart;
myValue = myRecord.myItem01;
myValue = myItem01;
デフォルト値 (最良実例) を受け入れることをお勧めします。コンテナー名を指定することにより、 コードを読み取る人と EGL に対するあいまいさを減らすことができます。
EGL は規則セットを使用して変数名または項目名が参照するメモリー領域を決定します。詳細については、『変数および定数の参照』を参照してください。
callingConvention に対して、現在使用可能な値は、I4GL のみです。追加情報については、『nativeLibrary 型のライブラリー・パーツ』を参照してください。
追加情報については、『nativeLibrary 型のライブラリー・パーツ』を参照してください。
詳細については、『VGVar.handleHardIOErrors』および『例外処理 』を参照してください。
ライブラリーが、そのライブラリーにない共用関数を使用している場合は、includeReferencedFunctions プロパティーを yes に設定した場合に限り、生成が可能になります。
no を指定すると、識別子はその実行単位全体で共用されます。そのライブラリー内の SQL ステートメントが呼び出されたときに作成された識別子は、そのライブラリーを呼び出すその他のコード内でも使用可能です。ただし、その他のコードは、localSQLScope = yes を使用して、これらの識別子へのアクセスをブロックすることができます。またライブラリーは、呼び出し側プログラムまたは pageHandler で作成される識別子を参照できます。ただし、参照できるのは、SQL 関連ステートメントがすでに他のコードで実行された場合、およびその他のコードがアクセスをブロックしなかった場合だけです。
いずれの場合でも、プログラムまたは pageHandler がライブラリーにアクセスするときに使用可能な識別子は、同じプログラムまたは pageHandler が、同じライブラリー内の同じ関数または別の関数にアクセスするときに使用可能です。
nativeLibrary 型のライブラリー内の関数には、private を指定できません。
パーツは、形式のモデルとして機能します。詳しくは、『Typedef』を参照してください。
パーツは、形式のモデルとして機能します。詳しくは、『Typedef』を参照してください。
基本レコードにはプロパティーはありません。