Small company logo:
   History
 
Advertising banner:
 
 ServerFile.GetResource
Home • Help • Customization Tools • FCAS • Language Reference • ServerFile.GetResource
 
Purpose
Retrieves the specified resource from an open .fc or .rez file.
Syntax
ServerFile.GetResource (ResourceType, ResourceID) BinaryType


ResourceType
A string representing the resource type.
ResourceID
An integer representing the resource ID.
BinaryType
The binary type for this resource.
The binary type is similar to string, but can include NULL characters.  Binary data is of arbitrary length with no terminator and includes the full eight bits of fidelity without translation, EOL or NULL manipulation.  It is commonly used for application executables, binary picture formats and other binary file types that are not human-readable.  In the case of .rez files, this is most often picture, icon or sound data.

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)