Jump to content

fileopen


Recommended Posts

#include <IE.au3>
#include <File.au3>
$file = FileOpen("logfile_" &@MDAY &@MON &@HOUR &@MIN &"_" &$ip & ".txt", 10)
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
FileWrite($file, "SQA Testing Started at: " & @MDAY & @MON & @YEAR & @HOUR & @MIN & @CRLF)


FileWrite($file, "SQA Testing Finished at: " & @MDAY & @MON & @YEAR & @HOUR & @MIN & @CRLF)
FileClose($file)

what am I missing?????

Edited by diikee
Link to comment
Share on other sites

I believe that your missing a path.

I also have to assume that $ip is declared somewhere.

Try.

$ip = 'Something'
$file = FileOpen(@scriptdir&"\logfile_" &@MDAY &@MON &@HOUR &@MIN &"_" &$ip & ".txt", 10)
Edited by Kerros

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Link to comment
Share on other sites

Jos,

I actually waited for a few minutes and the file started getting populated....

.txt file

Electronic Shutter is set to: fixed 1/8 sec

Electronic Shutter is set to: fixed 1/5 sec

Completed: Clicked on r

console:

Electronic Shutter is to: fixed 1/8 sec

Electronic Shutter is to: fixed 1/5 sec

Complete: Overlay text set to: $IMGCDBG 2

Complete: LightGrabber set to: 1x

Light grabber is set to: 1x

Light grabber set successfully

Close oi

Complete: LightGrabber set to: disabled

Light grabber is set to: DISABLED

Light grabber set successfully

Close oi

I got more log on the console than in the text file

what might be causing the delay in writing to the file???

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...