Purpose
Deletes the specified resource from an open .fc or .rez file.
Syntax
ServerFile.DelResource (ResourceType, ResourceID [, Commit as Integer = TRUE | FALSE] )
ResourceType |
A string representing the resource type. |
ResourceID |
An integer representing the resource ID. |
Commit as Integer |
TRUE is the default, and means the resource is committed to the server file immediately. FALSE means committing will be delayed until the ServerFile.CommitResource command is issued. This is for performance purposes. |
Example
Dim sf as ServerFile
Dim sf2 as ServerFile
Dim f as File
' Open the resource file from the server
sf.OpenFile("FCAS Config|JPEG1000.rez")
' Write a resource to local disk
f.OpenFile(fcpofolder & "\Test.JPG",fcWrite)
f.Write(sf.GetResource("JPEG",1000))
f.CloseFile
' Add a resource to another file
sf2.CreateFile("FCAS Config|newrez.rez",fcFile)
sf2.AddResource("JPEG",1000,"Name",sf.GetResource("JPEG",1000),FALSE)
sf2.AddResource("JPEG",1001,"Name",sf.GetResource("JPEG",1000),FALSE)
sf2.Commit
f.OpenFile(fcpofolder & "\Test2.JPG",fcWrite)
f.Write(sf2.GetResource("JPEG",1000))
f.CloseFile
f.OpenFile(fcpofolder & "\Test3.JPG",fcWrite)
f.Write(sf2.GetResource("JPEG",1001))
f.CloseFile
' Delete a resource from a server file
sf2.DelResource("JPEG",1000)
|