bobheart Posted June 11, 2004 Share Posted June 11, 2004 I have no errors but I can't seem to get it to write to the txt file if the drive is ready or not . the msg box works . $var = DriveStatus( "a:\" ) MsgBox(4096,"Status",$var) $var = FileOpen("test.txt", 1) ; Check if file opened for writing OK If $var = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($var, "DriveStatus") FileClose($var) Link to comment Share on other sites More sharing options...
pekster Posted June 11, 2004 Share Posted June 11, 2004 (edited) Don't you need to use the return of the DriveStatus call to put that in your file? The issue is that $var was getting overwritten with the FileOpen call, and you lost the return that held the status.$status = DriveStatus( "a:\" ) MsgBox(4096,"Status",$status) $var = FileOpen("test.txt", 1) ; Check if file opened for writing OK If $var = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($var, "DriveStatus is: " & $status) FileClose($var)Edited to match the MsgBox call to the new var name Edited June 11, 2004 by pekster [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
bobheart Posted June 11, 2004 Author Share Posted June 11, 2004 Ok I see how you did it . Man this stuff is tuff on me . thanks for the help . 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