博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
IDL structures array
阅读量:2445 次
发布时间:2019-05-10

本文共 1400 字,大约阅读时间需要 4 分钟。

Creating an Array of Structures


The easiest way to create an array of structures is to use the REPLICATE function. The first parameter to REPLICATE is a reference to the structure of each element. Using the example in  and assuming the STAR structure has been defined, an array containing 100 elements of the structure is created with the following statement:

cat = ({star}, 100)

Alternatively, since the variable A contains an instance of the structure STAR, then

cat = (A, 100)

Or, to define the structure and an array of the structure in one step, use the following statement:

cat = ({star, name:'', ra:0.0, dec:0.0, $
    inten:(12)}, 100)

The concepts and combinations of subscripts, subscript arrays, subscript ranges, fields, nested structures, etc., are quite general and lead to many possibilities, only a small number of which can be explained here. In general, any structures that are similar to the examples above are allowed.

It is now possible to concatenate anonymous structures as long as they have the same field sizes and types. That is to say, they do not even have to have the same field names. For example, consider this code, written in IDL 6.2.

IDL> a = {Name: 'Larry', Age: 46}   IDL> b = {LastName: 'Henderson', No_of_Dogs: 4}   IDL> c = [ a, b]   IDL> Help, c   C               STRUCT    = ->  Array[2]
IDL> a = b
IDL> Help, a, /str
a = {LastName: 'Henderson', No_of_Dogs: 4}

转载地址:http://iviqb.baihongyu.com/

你可能感兴趣的文章
您可能不知道WooCommerce可以做的10件事
查看>>
php使用nginx建网站_如何使用预建网站来刷新网站的外观
查看>>
wordpress快速建站_您的WordPress主题灵活还是快速?
查看>>
bootstrap布局技巧_加快Bootstrap网站的3个技巧
查看>>
bootstrap网格_Bootstrap网格:掌握最有用的Flexbox属性
查看>>
symfony 控制器_重新引入Symfony控制台-适用于未开始使用的CLI PHP!
查看>>
wordpress插件开发_WordPress插件开发简介
查看>>
响应式编程 函数式编程_Phunkie进行函数式编程:PHP中的解析器组合器
查看>>
composer 源l:_Visual Composer:名称更改的令人费解的故事
查看>>
使用React和PHP开发游戏:它们的兼容性如何?
查看>>
哈巴狗入门指南
查看>>
js设置css自定义变量_CSS变量实用指南(自定义属性)
查看>>
http建立个人服务器工具_建立网站和页面的最佳7种工具
查看>>
前端框架浏览器兼容解决方案_前端框架:定制与即用型解决方案
查看>>
驯服Snoo:使用Reddit API
查看>>
php页面不渲染显示源代码_PHP如何执行-从源代码到渲染
查看>>
Sourcehunt 17.1:值得关注的7个有趣PHP软件包
查看>>
使用转发装饰器实现模块化架构
查看>>
安恒 web类这可不是难题_如何消除您的前5个Web设计难题
查看>>
旅行者 问题_旅行者-管理员UI可以使Laravel更加平易近人吗?
查看>>