文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 使用IDL的12个小技巧
侵权投诉

使用IDL的12个小技巧

原文来自michaelgallory

译文有不妥之处请大家指正。

tip 1 put code in files. your choices are to write main-level programs, batch files, and normal procedures/functions. the bulk of your code should probably be in procedures and functions, but there are certainly reasons to use both main-level programs and batch files. main-level programs are handy for setting up a situation and allowing you to enter commands accessing the variables in the program after it has run. batch files are good for including code that needs to be typed in multiple locations.

把代码存放在文件中。你可以选择写主程序,批处理文件和常见的过程或函数。大量的代码应该是包含在过程和函数中,但是为什么要用主程序和批处理文件,这肯定是有它的原因的。主程序有利于环境的创建,在程序运行后你还可以输入命令来访问它的变量。批处理文件有利于存储那些需要在多个位置键入的代码。

tip 2 place your main routine last in a file and name the file the same as this routine plus a ".pro" extension. alternatively, you could put each routine in its own file with the same name as the routine plus a ".pro" extension. following this advice will save a big headache someday. when you manually compile your code, this tip doesn't matter. do this if you want idl to automatically find your code (and you will eventually, probably tomorrow).

把你的主程序放在文件的最后,并把此程序名作为文件名,以".pro"为扩展名。或者你可以把每个程序单独放在一个文件里,以程序名作为文件名,以".pro"为扩展名。这样做的好处是以后会给你省很多麻烦。当你手动编译你的代码时,这个方法是没什么用的。如果你想要idl自动找到你的代码时(你最终肯定要的,可能就是明天),就要用这个方法了。

tip 3 be aware of short integers. the default integer in idl is a 16-bit ("short") integer which has a range of -32,768 to 32,767. it is used in situations like: n = 5

where no specific type of integer is specified. if you want to change the default integer, put

compile_opt defint32

at the beginning of every routine where you want to change the behavior. or, always specify the type of integer you want, like

n = 5l

to create a long integer (32-bit).

注意短整型。idl中默认的整型是16位(“短”)整型,它的取值范围是-32,768到32,767。它用于下例情况下:

n = 5

这里没有指定整数的类型。如果你想要改变默认的整型,键入:

compile_opt defint32

在每个你想改变状态的程序的开头,或总是指定你想要的整型类型,如:

n = 5l

创建一个长整型(32位)

tip 4 put compile_opt strictarr at the beginning of every routine you write. the explanation is a bit subtle, but doing this will save you a day's work sometime. it comes down to the fact that both arr(5) and arr[5] can index into the array arr.

第1页

热门文档

相关文档

  • 12个小技巧使你的书桌整齐有序,学习更加高效

    个小技巧使你的书桌整齐有序,学习更加高效》 《12 个小技巧使你的书桌整齐有序,学习更加高效》生活常识 2010-08-04 22:25:27 阅读 259 评论 9 字号:大中小...

  • 这里有12个小技巧帮你快速整理你的书桌

    这里有12个小技巧帮你快速整理你的书桌_其它_高等教育_教育专区。这里有12个...这是个共识, 但是按美观来整理书桌却比按使用性更容易操作,两者皆可,随 你...

  • 12个小技巧让你健健康康用电脑

    引导语:现在每天使用电脑的人时间越来越长,长时间用完电脑后,很多情况下都会感到头晕 天给大家分享 2 个小技巧,让大家从此健健康康地用电脑,再也不怕长时间用...

  • 12个小技巧让你健康用电脑

    编后语:以上12个小小的技巧,能帮助我们更加 健康的去用电脑,每一个需要长时间用电脑的朋友都 应该收藏一份,也可以将这些小小的技巧,告诉自己 的朋友或家人,让...

  • 12个小技巧使你的书桌整齐有序

    12个小技巧使你的书桌整齐有序_生产/经营管理_经管营销_专业资料。管理小技巧12 个小技巧使你的书桌整齐有序,学习更加高效 1. 拿走你不用的钢笔和铅笔 一般...

  • 12个小技巧让你健健康康用电脑,长时间用电脑必备

    12 个小技巧让你健健康康用电脑,长时间用电脑必备引导语:现在每天使用电脑的人时间越来越长,长时间用完电脑后,很多情况下都会感到头 晕,眼睛累等情况,那么,今天...

  • 12个小技巧帮你整理书桌

    12个小技巧帮你整理书桌_互联网_IT/计算机_专业资料。生活小常识12 个小技巧帮你整理书桌拿走你不用的钢笔和铅笔 博华一般写字只用一种钢笔,但是每个月我 都会...

  • IDL入门教程七(上)

    第七章 图形硬拷贝输出本章概要在使用 IDL 的时候,如何以硬拷贝形式再现屏幕中...有个技巧可以用于强制让 PostScript 文件前进一页,这就是使用 Erase 命令。如果...

  • IDL图像初学教程

    书中后面的几章编程教程是建 立在前面几章中讲过的概念和技巧的基础上的。 IDL 所需的版本希望读者在学习本书时使用的是最新的 IDL 版本。本书写作时使用的...

  • IDL入门教程05

    怎样在图形显示技巧中使用 Z 图形缓冲区 将光标用于图形显示数据可视化显示的原因...这种交互作用在 IDL 中用 Cursor 命令很容易完成。 用 LoadData 命令装入 Time...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email