Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Get_Contract function ====== ==== Description ==== Retrieves contract block information for a specified stored procedure. ==== Syntax ==== //contractblock// = **Get_Contract** (//procname//, //prepost//, //clause//, //commentflag//, //textflag//) ==== Parameters ==== The Get_Contract function has the following parameters. ^Parameter^Description^ |//procname//|Specifies the name of the stored procedure.| |//prepost//|Indicates which part of the contract block is returned. If null, the default is 0.\\ \\ __prepost__ __Description__\\ 0 - //pre// and //post// conditions are returned (default).\\ 1 - The //pre// condition is returned.\\ 2 - The //post// condition is returned.| |//clause//|If you want to return a specific clause in the contract, indicate the clause number. A 1 indicates the first clause, a 2 indicates the second clause, etc. If no number is specified, all contract clauses are returned. If clause is less than zero, all contract clauses are returned.| |//commentflag//|If True (1), the comments are not returned with the contract information. By default, the comments are returned.| |//textflag//|If True (1), convert normal system delimiters (@FM, @VM, @SVM) to carriage return/linefeed characters, in the returned data.| If arguments passed to or returned from a stored procedure fail the contract clause conditions, an error is returned. The error contains the number of the contract clause that failed. You can pass the returned clause number to Get_Contract for additional information about the error.\\ \\ The contract information is returned in an @FM-delimited array. If both //pre:// condition and //post//: condition information is returned, //pre:// condition information is in field 1 and //post:// condition information is in field 2. If only //pre:// condition or //post:// condition is returned, only one field is returned.\\ \\ If multiple pre-conditions or post-conditions exist, they are returned as values in either field 1 or in field 2. Comments are returned as subvalues for each condition.\\ \\ If //textflag// is True (1), the //pre:// and //post:// condition information is separated by the literal "post". ==== See Also ==== [[contract_blocks|The "Contract Block" topic in Chapter 2: BASIC+ Language Reference]]. ==== Example ==== <code> /* Returns the Pre: and Post: conditions and comments from the contract block for the QUICK_REPORT stored procedure. */ ContractBlock = Get_Contract("QUICK_REPORT", "0") If Get_Status(ErrCodes) Then GoSub ErrorHandling End </code> guides/programming/programmers_reference_manual/get_contract.txt Last modified: 2024/06/19 20:20by 127.0.0.1