existでの「無効な名前がパラメーターに指定されています」
ao 2013/3/31(Sun) 13:23:39|NO.53354
こんにちは。
現在ダウンロードの進行度表示を http://hsp.tv/play/pforum.php?mode=all&num=40667 様を参考に作っているのですが、
進行度が100%になった時に、existのところで「無効な名前がパラメーターに指定されています」のエラーが出てしまいます。
hspinet.as
..
#deffunc downl str p1, str p2
SIZES = getpath(p1,8)
header = ""
neturl@ ""+getpath(p1,32)
netfileinfo@ header,""+SIZES
notesel header
FEW = ""
repeat notemax
noteget FEW,cnt
if instr(FEW,0,"Content-Length: ")=0:break
loop
filesize=int(strmid(FEW,strlen("Content-Length: "),256))
netdlname@ p2
neturl@ ""+getpath(p1,32)
netrequest@ ""+SIZES
percent = 0
repeat
netsize@ size : netexec@ res
exist p2
aa = strsize
percent = int(double(aa) / filesize * 100)
title ""+percent+" "+aa
if percent=100 : return
await 30
loop
return
#global
---
download.hsp
repeat 5
filename_0 = "aa0.jpg","aa1.jpg","aa2.jpg","aa3.jpg","aa4.jpg"
Folder = "C:\\Users\\aaa\\Desktop\\test\\"
fileurl = ""+filename_0.cnt
dlnam = ""+Folder+""+getpath(fileurl, 8)
downl "http://hoge.com/"+fileurl, dlnam
loop
サーバーにはaa_0.jpg〜aa_4.jpgがあります。
これを実行すると、1度目のループから100%になった時エラーが出てしまいます。
どこが間違っているのかさっぱり分からず、完全にお手上げ状態です。
アドバイスをご教授お願いします。
KA 2013/3/31(Sun) 14:09:01|NO.53356
原因がわからないのなら、スクリプトを一つにまとめた
りdeffuncやrepeatを使わないで、問題が発生する最小限
の記述にしてみましょう。
KA 2013/3/31(Sun) 14:12:03|NO.53357
あと、ぱっと見でインクルードしていないようです。