Jonniemac315 Posted October 22, 2007 Share Posted October 22, 2007 Why doesn't this work I keep getting errors. $Count = 1 $SecondaryCapturePath = "\\10.0.0.200\PhoneReport\phone" & $Count ".txt" Link to comment Share on other sites More sharing options...
weaponx Posted October 22, 2007 Share Posted October 22, 2007 The real question is...why DOES this work??? $Count = 1 $SecondaryCapturePath = "\\10.0.0.200\PhoneReport\phone" & $Count & ".txt" Link to comment Share on other sites More sharing options...
Jonniemac315 Posted October 22, 2007 Author Share Posted October 22, 2007 The real question is...why DOES this work??? $Count = 1 $SecondaryCapturePath = "\\10.0.0.200\PhoneReport\phone" & $Count & ".txt" I am trying to get a file to count up but it won't work. Is this not proper coding? If not can someone help me to how to fix this. This is what I get every time I try to run it. $SecondaryCapturePath = "\\10.0.0.200\PhoneReport\phone" & $Count ".txt" $SecondaryCapturePath = ^ ERROR >Exit code: 1 Time: 0.452 Link to comment Share on other sites More sharing options...
weaponx Posted October 22, 2007 Share Posted October 22, 2007 Dude. I posted the answer. Look more closely. Link to comment Share on other sites More sharing options...
guwguw Posted October 22, 2007 Share Posted October 22, 2007 I am trying to get a file to count up but it won't work. Is this not proper coding? If not can someone help me to how to fix this. This is what I get every time I try to run it. $SecondaryCapturePath = "\\10.0.0.200\PhoneReport\phone" & $Count ".txt" $SecondaryCapturePath = ^ ERROR >Exit code: 1 Time: 0.452Basically, a file CANNOT count ... Assuming your path is correct (accepted by the OS), you still need an "&" before ".txt". If you are storing the value "$Count" inside a file, the key command is 'FileWrite ( filehandle or "filename", "line" )' If you are trying to count something, there needs to be something like $Count +=1 before storing the new value. If you just want a count of files in a path, '_FileListToArray ( $sPath [, $sFilter [, $iFlag]] )' will have the count result in $array[0]. Here isan excerpt from the Help file: The array returned is one-dimensional and is made up as follows: $array[0] = Number of Files\Folders returned $array[1] = 1st File\Folder $array[2] = 2nd File\Folder $array[3] = 3rd File\Folder $array[n] = nth File\Folder 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