Jump to content

Recommended Posts

Posted

Hey guys,

I have been trying to make a script which requests some information and writes it to a notepad file after the information is entered... The whole script runs smoothly (variables, etc) except for the opening of the file/writing to the file..

I have tried Run and FileWriteLine, both with the same results... Was hoping that you could help me on this one

(I need this done soon... its a bit important, thanks)

Thanks for any feedback and help :D

I have put the script below

; Project: input hours
;means - notepad tracker?
If 2 = MsgBox (1,"TimeTracker","Welcome, would you like to begin?") then Exit
;vars
$date = InputBox ("TimeTracker","Input date and day"&@CRLF&"format [DAY] - [DATE]")
$phys = InputBox ("TimeTracker","Input hours done of Physics")
$chem = InputBox ("TimeTracker","Input hours done of Chemistry")
$math = InputBox ("TimeTracker","Input hours done of Math")
$file = FileOpen ("G:\StudyHours.txt",1)
if $file = 1 Then
FileWriteLine ("G:\StudyHours.txt",@CRLF&@CRLF&$date&@CRLF&$phys&@CRLF&$chem&@CRLF&$math)
MsgBox (0,"TimeTracker","Done! :D")
ElseIf $file = 0 Then
MsgBox (0,"TimeTracker","Sorry, file not found @_@")
EndIf
Exit

(The error in this case occurred at the file open, it said that it could not either open the file, or find it...)

Posted (edited)

; Project: input hours

;means - notepad tracker?

If 2 = MsgBox (1,"TimeTracker","Welcome, would you like to begin?") then Exit

;vars

$date = InputBox ("TimeTracker","Input date and day"&@CRLF&"format [DAY] - [DATE]")

$phys = InputBox ("TimeTracker","Input hours done of Physics")

$chem = InputBox ("TimeTracker","Input hours done of Chemistry")

$math = InputBox ("TimeTracker","Input hours done of Math")

;$file = FileOpen ("G:StudyHours.txt",1)

;if $file = 1 Then

FileWriteLine ("G:StudyHours.txt",@CRLF&@CRLF&$date&@CRLF&$phys&@CRLF&$chem&@CRLF&$math)

MsgBox (0,"TimeTracker","Done! :D")

;ElseIf $file = 0 Then

;MsgBox (0,"TimeTracker","Sorry, file not found @_@")

;EndIf

Exit

Edited by forumer100

App: Au3toCmd              UDF: _SingleScript()                             

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
×
×
  • Create New...