wenluderen

*******************************************************************

目的:定义一个整型数据

原型:Integer varName[(subscripts)],varName[(subscripts)],...........  

解释:Integer is used to declare variables as type Integer.  Variables of type Integer can contain(包含) whole numbers with values between -32768 to 32767.  

Local variables should be declared at the top of a function.  Global and module variables must be declared outside of functions.

Example:

 Integer A(10) \'Single dimension array of integer 
  Integer B(10, 10) \'Two dimension array of integer
  Integer C(5, 5, 5) \'Three dimension array of integer
  Integer var1, arrayvar(10)
  Integer i

*****************************************************************************************

目的:数据的附加修饰。

原型:

全局类型数据:Globle [Preserve] dataType varName [(subsricpts)],varName [(subsricpts)],..........

模块类型数据:

局部类型数据:

 

特别说明:对于全局变量还可以继续使用Preserve。 这样这个数据就可以保存下来。。

Example:

局部变量的声明 

Function main

Integer i

Fend

模块内变量的声明

Integer m_i

Function main

Fend

全部变量(全局保护变量)的声明

Globle (Preserve) Integer g_i

Function main

Fend

******

后记:细心的同学发现了 我在声明 模块变量和全部变量的时候 使用前缀 m_ 和g_   ,这是优秀程序员的基本素养。

这样以后看到变量的时候 就知道这个什么作用域的变量,提高代码的阅读体验。

×××××××××××××××××××××××××××××××××××××××××××××××××××××

分类:

技术点:

相关文章:

  • 2021-04-16
  • 2022-03-02
  • 2021-12-29
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2021-12-12
猜你喜欢
  • 2022-01-18
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2021-05-31
相关资源
相似解决方案