TheCreator Posted July 10, 2007 Share Posted July 10, 2007 Hello all, I've got some code, and I was wondering how I was supposed to manage this? I get an error that $ret wasn't declared? Here's a chunk of the code. pcode=autoit] $files=FileOpenDialog("file(s) to open?", _GetLastKnownDir(), "aiff(*.aiff)|wave(*.wav)|ogg vorbis(*.ogg)|flac(*.flac)|mp3(*.mp3)|mod(*.mod)|s3m(*.s3m)|it(*.it)|xm(*.xm)", 1+2+4) if not IsString($files) then return 0 EndIf $parse=StringSplit($files, "|") if ($parse[0]==1) then $path=StringSplit($parse[1], "\") $str="" for $i = 1 to $path[0]-1 $str=$str&$path[$i]&"\" next _WriteLastKnownDir($str) return EndIf _WriteLastKnownDir($parse[1]) for $counter = 2 to $parse[0] $parse[$counter]=$parse[1]&"\"&$parse[$counter] next $counter=ubound($parse)-2 dim $ret[$counter] $ret[0]=ubound($ret)-2 for $counter = 1 to $ret[0] $ret[$counter]=_ArrayPop($parse) next return $ret --error is here. EndFunc ~~TheCreator~~Visit http://tysdomain.com for personal software and website solutions. Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 10, 2007 Share Posted July 10, 2007 (edited) Hello all,I've got some code, and I was wondering how I was supposed to manage this?I get an error that $ret wasn't declared?Here's a chunk of the code.Well... you've got an EndFunc without a Func, which is kind of.... wait for it... funky! GRROOOOOoooooan! P.S. ...and, sure enough, $ret is not declared. We seem to be missing a lot of code here. Edited July 10, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
cppman Posted July 10, 2007 Share Posted July 10, 2007 (edited) Well... you've got an EndFunc without a Func, which is kind of.... wait for it... funky! GRROOOOOoooooan! P.S. ...and, sure enough, $ret is not declared. We seem to be missing a lot of code here. --> dim $ret[$counter] Func X() $files=FileOpenDialog("file(s) to open?", "", "aiff(*.aiff)|wave(*.wav)|ogg vorbis(*.ogg)|flac(*.flac)|mp3(*.mp3)|mod(*.mod)|s3m(*.s3m)|it(*.it)|xm(*.xm)", 1+2+4) if not IsString($files) then return 0 EndIf $parse=StringSplit($files, "|") if ($parse[0]==1) then $path=StringSplit($parse[1], "\") $str="" for $i = 1 to $path[0]-1 $str=$str&$path[$i]&"\" next ;_WriteLastKnownDir($str) return EndIf ;_WriteLastKnownDir($parse[1]) for $counter = 2 to $parse[0] $parse[$counter]=$parse[1]&"\"&$parse[$counter] next $counter=ubound($parse)-2 dim $ret[$counter] $ret[0]=ubound($ret)-2 for $counter = 1 to $ret[0] $ret[$counter]=_ArrayPop($parse) next return $ret; --error is here. EndFunc $hello = x() _ArrayDisplay($hello) Works for me. Edited July 10, 2007 by chris95219 Miva OS Project Link to comment Share on other sites More sharing options...
TheCreator Posted July 10, 2007 Author Share Posted July 10, 2007 chris, you broke my eago! ~~TheCreator~~Visit http://tysdomain.com for personal software and website solutions. 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