Sign in to follow this  
Followers 0
Guest ExCeeded

Quick Help.

3 posts in this topic

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



#2 ·  Posted (edited)

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  
Followers 0