没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
About IFS Client Developer Help
The IFS Client Developer help system provides quick lookup information on all of
IFS Client Developer features.
Scalable Application Language
Scalable Application Language (SAL) is a procedural language used for writing Centura actions
(procedures) that you want your application to execute when events take place.
You add SAL statements
to:
• The Application Actions
section of an outline.
• The Actions section of an Internal Function.
• The Menu Actions section of a menu item.
• The Message Actions
section of an object.
See Also
Conventions
Statements
Operators
Data Types
Arrays
Variables
Constants
Expressions
Command Line Arguments
System Functions
Internal Functions
External Functions
Conventions
Conventions and standards exist and should be maintained when defining objects, variables,
and constants, and adding SAL statements to your application outline.
Following are some general rules and guidelines you should remember:
• Centura is case sensitive. Upper and lower case characters are interpreted differently.
• Prefixes of objects, functions, and messages are important for maintaining consistency
within an application, and for making it easy to read.
SAL functions start with the prefix ‘Sal’ or 'Sql'.
SAM messages start with the prefix ‘SAM_’.
Centura objects start with the following prefixes:
Object Prefix
Check Box
cb
Combo Box
cmb
Data Field
df
Dialog Box
dlg
Form Window
frm
List Box
lb
Multiline Text Field
ml
Picture
pic
Push Button
pb
Radio Button
rb
Scroll Bar (Horizontal/Vertical)
sb
Table Window
tbl
Centura constants and variables start with the following prefixes:
Data Type Prefix
Boolean
b
Date/Time
dt
File Handle
fh
Long String
ls
Number
n
Sql Handle
hSql
String
str
Window Handle
hWnd
Statements
Following is a list of keywords you use in building SAL statements. Add SAL statements to:
• The Application Actions
section of an outline.
• The Actions section of an Internal Function.
• The Menu Actions section of a menu item.
• The Message Actions
section of an object.
You code SAL statements in these sections:
• Message Actions.
• Function Actions.
• Application Actions.
• Menu Actions.
The SAL keywords are:
Break
Call
If-Else,Else-If
Loop
On
Return
Select Case, Case, Default
Set
When SqlError
While
Break
Break terminates the Loop or While statement under which it is nested. This lets you break out
of more than one level of loop.
If you specify a loop name, that loop terminates. If you do not specify a loop name, the
statement breaks out of the nearest loop level.
You can also use Break to terminate a Case item under a Select Case
statement.
The syntax is:
Break [loop_name]
This example fetches rows and breaks out of one level of loop on a return of FALSE:
Loop
If NOT SqlFetchNext ( hSql, nInd )
Break
If nInd = FETCH_EOF
Call SalMessageBox ( ‘No more rows’, ‘Select’, MB_Ok )
Break
Call
Call executes a function.
The syntax is:
Call Function_name (parameters)
This example calls two functions, SalStrUpper and SqlImmediate:
Call SalStrUpper ( strSource, strTarget )
Call SqlImmediate ( ‘DELETE FROM CUSTOMER WHERE NAME = :fldName’ )
If Else or Else If
Use If Else or Else If to express options. Indentation determines the conditional flow of control.
The Else If or Else portion is optional. You can add as many levels of Else If statements as you
like, but there can only be one Else statement.
The syntax is:
If Expression1
Statement1
Else If Expression2
Statement2
Else
Statement3
In the syntactic example above, Centura evaluates Expression1. If it is true, Statement1
executes. If it is false, Centura evaluates Expression2. If Expression2 is true, Statement2
executes. If it is false, Statement3 executes.
Example:
If fldB = ‘M’
Call ProcessMale ( fldSex )
Else If fldB = ‘F’
Call ProcessFemale ( fldSex )
Else
Call ProcessOther ( fldSex )
You can also code the preceding actions using a slightly different style (nested Ifs):
If fldB = ‘M’
Call ProcessMale ( fldSex )
Else
If fldB = ‘F’
Call ProcessFemale ( fldSex )
Else
Call ProcessOther ( fldSex )
Loop
Loop repeats any child statements indented under it until a Break or Return executes.
The syntax is:
Loop [loop_name]
where the loop name is optional.
Example 1:
Set Count = 0
Loop
If Count = 100
Return TRUE
Set Count = Count + 1
Example 2:
Set y = 0
Set z = 0
Loop Outer
If z > 10
Set z = z + 1
Break
Loop Inner
If y > 10
Break
If GetData = 10
Break Outer
Set GetData = ValCheck ( )
Set y = y + 1
On
On relates a message to the SAL statements that execute when that message is received by an
object. Use On statements only in an object's Message Actions
section or the outline's
Application Actions
section.
You can identify messages by their numbers, or by their constant names which symbolize their
values. For example, when an application receives a SAM_AppStartup message, the SAL
statements coded in the application's Application Actions section of the outline execute.
The syntax is:
On Message
In this example, when the application starts, a modal dialog box appears that lets you login:
Global Declarations
...
Application Actions
On SAM_AppStartup
Call SalModalDialog ( LoginBox, hWndNull )
Return
Return breaks the flow of control and returns a value to the caller.
The syntax is:
Return Expression
Example:
Message Actions
On SAM_KillFocus
Return SalIsNull ( fldName )
If you are using a function that returns a Boolean value but you do not include a Return
statement in your code, the function returns FALSE.
If you are using a function that returns a numeric value but you do not include a Return
statement in your code, the function returns zero (0).
Select Case, Case, Default
Use Select Case when you have a series of conditions that you want to test.
With the Select Case statement, Centura successively compares the value of an expression
against Case constants. Both the expression and the constants must be number data types.
A Break statement signals the end of a Case, and terminates execution of the Select Case
statement. You must have a Break at the end of each Case statement unless you want the
program to continue execution through to the next Case. The Default case is optional, and if it is
present, it is placed at the end of the Select Case statement. It executes when the value of the
expression does not match any of the case constants.
The syntax is:
Select Case (Expression)
Case Constant1
Statement1
Break
Case Constant2
Statement2
Break
Default
Statement3
In the above example, Centura evaluates Expression. If its value matches that of Constant1,
then Statement1 executes. If its value matches that of Constant2, then Statement2 executes. If
no Case constant value matches that of Expression, then Statement3 executes.
You can specify as many Case constants as you want, but there can be only one Default section.
Indentation determines the conditional flow of control. Use Break to terminate a Case.
To allow more than one Case constant to execute the same statement, stack them like this:
Select Case (Expression)
Case Constant1
Case Constant2
Statement1
剩余2016页未读,继续阅读
资源评论
叡
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 在不同操作系统下编译Android源码需要更改一些Android源码的配置项,脚本用于自动化更改配置项.zip
- 基于vue3的春节烟花许愿代码.zip学习资料
- YoloV8.2.10的YOLOV8的Segmentation权重文件
- YoloV8.2.10的YOLOV8的Pose权重文件
- 2002 年 Python 周模板 - 4 月 25 日至 29 日 LINUXTips.zip
- 烟花爆炸效果学习代码.zip学习资料开发
- 微信抢红包助手.zip学习资料参考资料程序
- YoloV8.2.10的YOLOV8的Classification权重文件
- 探索Python科学计算:SciPy库的深入指南
- 深入解析栈溢出:原因、影响与解决方案
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功