ArcPad Scripting Object Model
Copy Method
See Also  Example  Send comments on this topic.
ExistingFileName
Required. A String that represents the full path of the file to be copied.
NewFileName
Required. A String that represents the full path of the destination file to copy to.
FailIfExists
Optional. A Boolean that specifies whether to abort the copy if the destination file already exists.
File Object : Copy Method

Glossary Item Box

Description

Copies an existing file to a new file.

Syntax

object.Copy ( ExistingFileName, NewFileName [,FailIfExists] )

Parameters

ExistingFileName
Required. A String that represents the full path of the file to be copied.
NewFileName
Required. A String that represents the full path of the destination file to copy to.
FailIfExists
Optional. A Boolean that specifies whether to abort the copy if the destination file already exists.

Return Type

Boolean

Remarks

FailIfExists is a boolean specifying whether to abort the copy if the destination file already exists. If not specified, FailIfExists is False. [Optional].

Example

File.Copy Example (VBScript)Copy Code
'Variables
Dim GPSfile, origFile, newFile, timeString

'Create File Object. This enables you to copy files
Set GPSfile = Application.CreateAppObject("file")

'Set the variables to the correct location and file name
origFile = preferences.properties("datapath") & "\GPSCorrect.ssf"
newFile =  preferences.properties("datapath") & "\GPSCorrect_" & now & ".ssf"
timeString = hour(now) & minute(now)& second(now)

'Check to see if the GPS correct file exists, if not then its business as usual
if GPSfile.exists(preferences.properties("datapath") & "\GPSCorrect.ssf") = true then
	origFile = preferences.properties("datapath") & "\GPSCorrect.ssf"
	newFile =  preferences.properties("datapath") & "\GPSCorrect_" & timeString & ".ssf"
	Call GPSfile.Copy(origFile,newFile)
end if

See Also

© 2013 All Rights Reserved.