IDL common block
来源:互联网 发布:如何禁止系统安装软件 编辑:程序博客网 时间:2024/04/27 09:24
Note on Common Block Variable Names
Variables in IDL COMMON blocks do not actually have names. Rather, IDL represents COMMON blocks internally as an array of variables, and these variables are referenced by their positional index. Hence, the first variable is at position 0, the second at position 1, and so forth. When you specify a COMMON block declaration in an IDL routine, you specify names to be used for these variables within the scope of that routine.
Common Block Definition Statements
The common block definition statement creates a common block with the designated name and places the variables whose names follow into that block. Variables defined in a common block can be referenced by any program unit that declares that common block. The general form of the COMMON block definition statement is as follows:
COMMON Block_Name, Variable1, Variable2, ..., Variablen
The number of variables appearing in the common block cannot change after the common block has been defined. The first program unit (main program, function, or procedure) to define the common block sets the number of included variables; other program units can reference the common block with any number of variables up to the number originally specified. Different program units can give the variables different names, as shown in the example below.
Example
The two procedures in the following example show how variables defined in common blocks are shared.
PRO ADD, A
COMMON SHARE1, X, Y, Z, Q, R
A = X + Y + Z + Q + R
PRINT, X, Y, Z, Q, R, A
RETURN
END
PRO SUB, T
COMMON SHARE1, A, B, C, D
T = A - B - C - D
PRINT, A, B, C, D, T
RETURN
END
The variables X, Y, Z, and Q in the procedure ADD are the same as the variables A, B, C, and D, respectively, in procedure SUB. The variable R in ADD is not used in SUB. If the procedure SUB were to be compiled before the procedure ADD, an error would occur when the COMMON definition in ADD was compiled. This is because SUB has already declared the size of the COMMON block, SHARE1, which cannot be extended.
- IDL common block
- IDL
- IDL
- IDL
- IDL
- OPCCOMN.IDL
- IDL是什么?
- 什么是IDL
- IDL语法
- .IDL文件
- IDL是什么?
- IDL字体
- IDL字体
- IDL文件
- IDL文件
- IDL详解
- IDL初识
- IDL入门
- 设置的mysql密码无效的问题
- 【iOS开发】swift 3.0 延长设置launch image启动页面图片显示时间
- 多态总结,接口知识==0914
- 如何设置Oracle客户端与服务器的字符集一致
- Java继承,在构造函数内对父类初始化的问题
- IDL common block
- 【Java TCP/IP Socket】基于NIO的TCP通信(含代码)
- python术语
- 单向加密
- 【Java TCP/IP Socket】深入剖析socket——数据传输的底层实现
- HTML元素显示方式
- LightOJ1422-Halloween Costumes
- 【Java TCP/IP Socket】深入剖析socket——TCP通信中由于底层队列填满而造成的死锁问题(含代码)
- Hadoop内核解析