VicTT Posted June 20, 2005 Share Posted June 20, 2005 Dim $arr[2] $in=FileOpen("elevi.txt",0) $out=FileOpen("elevi.out",2) while 1 $inst=FileReadLine($in) if @error=-1 then ExitLoop $inst=StringRight($inst,2) $arr=StringSplit($inst,",") $nume=$arr[1] $judet=StringStripWS($arr[2],8) if $ljudet<>$judet then FileWriteLine($out,$judet) FileWrite($out,$nume) $ljudet=$judet wend What's wrong with this code bit????!!!!! I keep getting an error on line 10 "Array variable has incorrect number of subscripts or subscript dimension range exceeded." Pls help.. Quote Together we might liveDivided we must fall Link to comment Share on other sites More sharing options...
w0uter Posted June 20, 2005 Share Posted June 20, 2005 (edited) $arr[2] means you can use: 1: $arr[0] 2: $arr[1] and your trying to call $arr[2] btw you also overwrite your array with stringsplit. you dont have to pre-declare it if it is used in stringsplit. Edited June 20, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
VicTT Posted June 20, 2005 Author Share Posted June 20, 2005 Ok..make that $arr[100]..it doesn't matter..I added that just because I thought I haven't declared it right....Same thing with Dim $arr[100], $arr[1000] or $arr[514].. Quote Together we might liveDivided we must fall Link to comment Share on other sites More sharing options...
w0uter Posted June 20, 2005 Share Posted June 20, 2005 (edited) i need to know what is in elivi.txt could you attach it ? [edit] i think you mean StringTrimRight instead of TrimRight. now you only got 2 chars. and i think that is unable to split into more then 1 [/edit] Edited June 20, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
VicTT Posted June 20, 2005 Author Share Posted June 20, 2005 Lols..YEP!!!:)Thanks a dozen..I'll check it out ) Quote Together we might liveDivided we must fall Link to comment Share on other sites More sharing options...
VicTT Posted June 20, 2005 Author Share Posted June 20, 2005 (edited) Yep..got it fixed..here's the final version..(not that it would be of use to anyone here)..Thanks for the StringRight remark, w0uter..I guess I'm not as 31337 in AutoIt as I thought I was ..(Btw..It seems that FileReadLine reads everything on the line BUT the @CRLF..so there was no need for a StringTrimRight after all..I guess I'm just used to 'sockets' ))..thanks again Dim $arr[100] Dim $ljudet $in=FileOpen("elevi.txt",0) $out=FileOpen("elevi.out",2) while 1 $inst=FileReadLine($in) if @error=-1 then ExitLoop $arr=StringSplit($inst,",") $nume=$arr[1] $judet=StringStripWS($arr[2],8) if $ljudet<>$judet then FileWriteLine($out,$judet) FileWriteLine($out,$nume) $ljudet=$judet wend Edited June 20, 2005 by VicTT Quote Together we might liveDivided we must fall Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now