Jump to content

fileRead for a "$var"


Recommended Posts

just looking for some tips on the best way to do this

i want to write information to at .txt, i use @ComputerName to separate all of my entries

is there a way to do a file read for the @ComputerName as a variable and say if it exists in the .txt then , msgbox an error?

Link to comment
Share on other sites

This possibly the answer to the first part of your question:

#include<Date.au3>

$file = FileOpen("mytest.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWriteLine($file, @ComputerName & @crlf)
FileWriteLine($file, _NowDate())

Not sure what you mean about the other, but it sounds like "IsKeyword" might do the trick

Good Luck!

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...