青未了分享 http://blog.sciencenet.cn/u/yanghang

博文

IDL控制语句

已有 5965 次阅读 2015-5-4 20:26 |个人分类:IDL学习笔记|系统分类:科研笔记

说明:作者只是提纲挈领的总结简单语句,起提示作用。详细语法需参考帮助文档。本人也是现用现学,总结不完善,部分内容也可能来自网络,请围观者指正。

一、if语句

1.单分支:

格式:

1.1 if  条件  then  语句

1.2 if  条件  then  begin

      语句

   endif

2.双分支:

2.1 if  条件  then  语句  else  语句

2.2 if  条件  then  begin

       语句

   endif  else  begin

       语句

   endelse  ;注意是endelse不是endif

3.多分支:

   if  条件  then  begin

       语句

   endif  else  if  条件  then  begin

       语句

   endif  else  if  条件  then  begin

       语句

   endif  else  begin

       语句

   endelse

二、for语句

Syntax :

FOR variable = init, limit [, Increment] DO statement

or

FOR variable = init, limit [, Increment] DO BEGIN

  statements

ENDFOR

三、while

WHILE expression DO statement

or

WHILE expression DO BEGIN

  statements

ENDWHILE




https://wap.sciencenet.cn/blog-346157-887361.html

上一篇:IDL编译
下一篇:IDL运算符
收藏 IP: 150.229.195.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-29 19:41

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部