Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1069570
  • 博文数量: 106
  • 博客积分: 9093
  • 博客等级: 中将
  • 技术积分: 2770
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-01 17:22
文章分类

全部博文(106)

文章存档

2014年(1)

2012年(29)

2011年(32)

2010年(20)

2008年(24)

分类: 系统运维

2012-08-06 17:05:23

我们在使用RPGLE编程的时候,有两种格式供我们选择:固定格式(Fixed-format)和自由格式(free-format)。

我们知道固定格式的注释和自由格式的注释是不同的。
固定格式
D Wait            S              1A                         
C* A comment, this is so you can read your program later.   
C* Anything after the * is ignored by RPGLE fixed format    
C                   Eval      String = 'Hello World!'       
C     String        Dsply                 
。。。             
              
     
自由格式
D Wait            S              1A                          
 /free                                                       
   // A comment, this is so you can read your program later. 
   // Anything after the * is ignored by RPGLE fixed format  
   String = 'Hello World!';                                  
   dsply String;            // this a comment
   。。。。
 /end-free

其实我们可以在固定格式中使用自由格式的注释
D Wait            S              1A               
 //display a string on terminal                   
C     'Hello World' Dsply                   Wait  
大家也许都以为自由格式的注释应该在/free和/enf-free之间,其实不然。
大家可以试一试。
阅读(1765) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~