Jump to content
Sign in to follow this  
Guest ExCeeded

Quick Help.

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.

Share this post


Link to post
Share on other sites
GaryFrost

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.

 

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.