Overflow_ Posted April 3, 2016 Share Posted April 3, 2016 Hello, Anyone can tell me why i got this error ? "C:\Users\Saymyname\Desktop\test.au3" (18) : ==> Subscript used on non-accessible variable.: _ReplaceStringInFile($Last, $Check[0], "OneFuckinRndString") _ReplaceStringInFile($Last, $Check^ ERROR Func _rnd($sDir) Local $sArray FileCopy($sDir, @ScriptDir & "\Random.txt") _FileReadToArray("Random.txt", $sArray) For $i = 1 To Ubound($sArray) - 1 $Check = _StringBetween( $sArray[$I], '$', ' ') ; function ( $Last = "Random.txt" FileRead($Last, FileGetSize($Last)) _ReplaceStringInFile($Last, $Check[0], "OneFuckinRndString") Next EndFunc in file, i have only this: $string1 = null $string2 = null $string3 = null Link to comment Share on other sites More sharing options...
iamtheky Posted April 3, 2016 Share Posted April 3, 2016 (edited) Do an IsArray on $Check prior to your replacestringinfile, If it fails skip that function because there will be no $Check[0] Edited April 3, 2016 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Overflow_ Posted April 3, 2016 Author Share Posted April 3, 2016 nice, thanks bud. 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