Jump to content

Quick Help.


Guest ExCeeded
 Share

Recommended Posts

Guest ExCeeded

Place_File()
Write_Something("Sup")



;;;;;;;;;;;;;;;;;;   Functions  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;--------------------------------------------------------------

Func Write_Something($Msg)

 Local $Exists = FileExists("C:\Any File.TxT")
 If $Exists = 1 Then
   FileMove ("Any File.TxT",@ScriptDir & "\Any File.TxT")
 Else
   FileOpen("Any File.TxT",1)
   FileWrite("Any File.TxT",$Msg)
 EndIf
 ReTurn
EndFunc

;--------------------------------------------------------------

Func Place_File()
    
    FileMove (@scriptdir & "\Any File.TxT","C:\Any File.TxT")
    Return
EndFunc

;--------------------------------------------------------------

I'm receiving an error.

Link to comment
Share on other sites

No errors here, although you might want to be consistant to where the file is and tell what the error is and don't forget to close file.

Place_File()
Write_Something("Sup")



;;;;;;;;;;;;;;;;;;   Functions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;--------------------------------------------------------------

Func Write_Something($Msg)

Local $Exists = FileExists("C:\Any File.TxT")
If $Exists = 1 Then
   FileMove ("C:\Any File.TxT",@ScriptDir & "\Any File.TxT")
Else
   FileOpen("C:\Any File.TxT",1)
   FileWrite("C:\Any File.TxT",$Msg)
    FileClose("C:\Any File.Txt")
EndIf
ReTurn
EndFunc

;--------------------------------------------------------------

Func Place_File()
    
    FileMove (@scriptdir & "\Any File.TxT","C:\Any File.TxT")
    Return
EndFunc
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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