0

ファイル 1.txt を、次のコードを記述した R1 の行を除いて、元の内容に置き換えたいと考えています。

FileOpen $0 "1.txt" "r"                     
GetTempFileName $R0                         
FileOpen $1 $R0 "w"                        
loop:
    FileRead $0 $2                         
    IfErrors done                          
    strcmp $R1 $2 loop here
    here:                                  
       FileWrite $1 $2                     
       Goto loop
done:
    FileClose $0                                    
    FileClose $1
    Delete "1.txt"
    CopyFiles /SILENT $R0 "1.txt"
    Delete $R0

しかし、うまく動作せず、1.txt をそのまま保持します。誰かが問題の場所を見つけるのを手伝ってくれませんか?

4

1 に答える 1

1

私はちょうど同じ問題に遭遇しました。"loop:" の前に ClearErrors コマンドを挿入して修正しました。

于 2010-03-31T13:05:34.897 に答える