2282_zh-CN
创建数组我正在尝试创建一个简单的数组 a[1] = "string 1"..... a[10] = "string 10"
我通过从表中读取值来创建这个数组,同时使用 FOR 语句进行循环。 我在第一次引用 a[1] 时遇到错误。 (实际上是一个j 已正确初始化并递增。
我究竟做错了什么? 我尝试寻求帮助,但没有找到我要找的东西。
谢谢,回复:创建数组您不需要使用 For 循环来获取列值。 使用 GET VALUES 可能会更快:
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">dt
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">=
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: rgb(0, 0, 221);">打开
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">(
style="font-size: 10pt; font-family: "快递新"; color: Purple;">"$SAMPLE_DATA\Big
类.jmp"
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">)
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">;
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: green;">/*
引用列的两种方法
显示:
style="font-size: 10pt; font-family: "快递新"; color: green;">
style="font-size: 10pt; font-family: "快递新"; color: green;">
第一种方法很有用,如果
列名称包含有趣的字符,例如斜杠
style="font-size: 10pt; font-family: "快递新"; color: green;">*/
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: black;">name_list
风格=“”>
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">=
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: rgb(0, 0, 221);">列
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">(
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">dt
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">,
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: Purple;">"名称"
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">)
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;"><<
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
获取值
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">;
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: black;">age_list
风格=“”>
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">=
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: rgb(0, 0, 221);">列
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">(
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">dt
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">,
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: Purple;">"年龄"
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">)
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;"><<
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
获取值
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">;
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: green;">/*
如果该列是
简单的名称直接引用它*/
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: black;">sex_list
风格=“”>
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">=
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">:
style="font-size: 10pt; font-family: "快递新"; color: black;">性别
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;"><<
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
获取值
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">;
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: black;">height_list
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">=
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">:
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">高度
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;"><<
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
获取值
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">;
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: black;">weight_list
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">=
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">:
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">重量
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;"><<
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
获取值
style="font-size: 10pt; font-family: "快递新"; color: 海军蓝;">;
style="font-size: 10pt; font-family: "快递新"; color: 黑色;">
问候,
彼得回复:创建数组谢谢,这解决了我的问题!回复:创建数组您可能需要“a”作为列表。 尝试在代码前面添加一行: a = {};
然后查看“列表”、“关联数组”和矩阵(或矩阵)的脚本 pdf 文档。
Comments
There are no comments yet