Chinaunix首页 | 论坛 | 博客
  • 博客访问: 345597
  • 博文数量: 90
  • 博客积分: 847
  • 博客等级: 准尉
  • 技术积分: 1373
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-02 10:54
个人简介

跌打滚爬中的小菜鸟...

文章分类

全部博文(90)

文章存档

2015年(5)

2013年(47)

2012年(38)

我的朋友

分类: 其他UNIX

2013-09-22 21:34:06

How subprocedures, pgms (main procedure) can be ended or deleted


subprocedure通过RETURN结束, 或者所有语句执行完结束
A subprocedure is ended by the RETURN operation or by reaching its last statement. Then all local (automatic) variables are removed from the stack except the static variables (those with the STATIC keyword) that are retained.


program 或者说main procedure有两种结束方式
直接return, 此时程序中打开的file继续处于open状态, ODP(open data path)不删除,并且可用
先SETON LR,然后return, 此时程序中打开的file会被close, ODP被删除
A program (main procedure) is ended by:
- Issuing the RETURN operation withou turning on the LR indicator. In this case, all files remain open (open data paths are still available) and static variables remain untouched.
- Setting the LR indicator on and then returning. In this case, the files are closed (open data paths are deleted), and static variables remain allocated but are marked for future initialization. If the main procedure is called later again, the static storage is initialized without a new allocation.
阅读(1614) | 评论(0) | 转发(0) |
0

上一篇:使用procedure pointer

下一篇:CBL 续行

给主人留下些什么吧!~~