私はちょうどAHKを使い始めています。4列、スペースとタブ区切り文字、および未知数の行からなるテキストファイルの読み方を教えています。配列から項目を返すのに問題がある
文字列 "xcal"を含む行の最初のトークンを取得し、その最初のトークン(%A_Index%= 1、右?)を配列(RunNum)に格納しようとしています。 MsgBoxに表示されます。あなたの説明に基づいて、このデータを使用して
#SingleInstance, Force
RunNum := Object() ; Initialize temporary array
; ----------------- Read LIST.TAB. ---------------------------
IfNotExist, %A_ScriptDir%\LIST.TAB
{
MsgBox,48,Error!, LIST.TAB was not found.
ExitApp
}
else
{
RunCount = 1 ; Set Run counter
Loop, read, %A_ScriptDir%\list.tab ; Read config file
{
IfInString, A_LoopReadLine, xcal ; If current line contains the word 'xcal'...
{
Loop, Parse, A_LoopReadLine, %A_Space% %A_Tab% ; Parse through current line of config file, space and tab delimiter
{
if (%A_Index% = 1) ; Continue if at the first element/token of string
{
RunNum[RunCount] := A_LoopField ; Store current field in RunNum array
RunCount+=1 ; Increase counter
}
}
}
}
MsgBox % RunNum[RunCount]
}
右が 'です記号 –
また、最も内側の '' if''が不足しているようですそれに続く2つの行の中括弧。 – wOxxOm
%を削除すると何も変更されません。そして、私は中括弧をifループに追加するのを忘れていたに違いありませんが、実際のスクリプトの中にあります。 私は配列の値をどのように表示することができないのか、または配列が偶数の場合でも理解できませんか? – Glycoversi