2282_ja-JP
配列の作成単純な配列 a[1] = "string 1".... a[10] = "string 10" を作成しようとしています
FOR ステートメントをループしながら、テーブルから値を読み取ることでこの配列を作成しています。 a[1] への最初の参照でエラーが発生します。 (実際にはj は初期化され、正しくインクリメントされます。
私は何を間違っているのでしょうか? ヘルプを参照しようとしましたが、探しているものが見つかりません。
ありがとう、Re: 配列の作成列の値を取得するために For ループを使用する必要はありません。 GET VALUES を使用した方が早いかもしれません。
style="font-size: 10pt; font-family: "Courier New"; color: black;">dt
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">=
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">開く
style="font-size: 10pt; font-family: "Courier New"; color: black;">(
style="font-size: 10pt; font-family: "Courier New"; color: purple;">"$SAMPLE_DATA\Big
クラス.jmp」
style="font-size: 10pt; font-family: "Courier New"; color: black;">)
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">;
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: green;">/*
列を参照する 2 つの方法
示されています:
style="font-size: 10pt; font-family: "Courier New"; color: green;">
style="font-size: 10pt; font-family: "Courier New"; color: green;">
最初の方法は、
列名にスラッシュなどのおかしな文字が含まれている
style="font-size: 10pt; font-family: "Courier New"; color: green;">*/
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: black;">name_list
スタイル="">
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">=
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">列
style="font-size: 10pt; font-family: "Courier New"; color: black;">(
style="font-size: 10pt; font-family: "Courier New"; color: black;">dt
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">,
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: purple;">"name"
style="font-size: 10pt; font-family: "Courier New"; color: black;">)
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;"><<
style="font-size: 10pt; font-family: "Courier New"; color: black;">
値を取得する
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">;
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: black;">age_list
スタイル="">
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">=
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">列
style="font-size: 10pt; font-family: "Courier New"; color: black;">(
style="font-size: 10pt; font-family: "Courier New"; color: black;">dt
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">,
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: purple;">"age"
style="font-size: 10pt; font-family: "Courier New"; color: black;">)
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;"><<
style="font-size: 10pt; font-family: "Courier New"; color: black;">
値を取得する
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">;
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: green;">/*
列が
単純な名前を直接参照するだけです */
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: black;">sex_list
スタイル="">
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">=
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">:
style="font-size: 10pt; font-family: "Courier New"; color: black;">性別
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;"><<
style="font-size: 10pt; font-family: "Courier New"; color: black;">
値を取得する
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">;
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: black;">height_list
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">=
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">:
style="font-size: 10pt; font-family: "Courier New"; color: black;">高さ
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;"><<
style="font-size: 10pt; font-family: "Courier New"; color: black;">
値を取得する
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">;
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: black;">weight_list
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">=
style="font-size: 10pt; font-family: "Courier New"; color: black;">
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">:
style="font-size: 10pt; font-family: "Courier New"; color: black;">weight
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;"><<
style="font-size: 10pt; font-family: "Courier New"; color: black;">
値を取得する
style="font-size: 10pt; font-family: "Courier New"; color: ネイビー;">;
style="font-size: 10pt; font-family: "Courier New"; color: black;">
よろしく、
ピーターRe: 配列の作成ありがとう、これで問題は解決しました!Re: 配列の作成リストにするためにはおそらく「a」が必要です。 コードの前に a = {}; という行を追加してみてください。
次に、「リスト」、「連想配列」、および行列 (または行列) に関するスクリプト PDF ドキュメントを参照してください。
Comments
There are no comments yet