Name
SetDefaultAdapter -- set default adapter (V10.0)
Synopsis
SetDefaultAdapter(type, adapter$)
Function
This function can be used to set the default adapter for the type specified by type to the adapter specified by adapter$. All Hollywood functions that support adapters of the specified type will then default to the adapter set using this function.

The following adapter types are currently supported by Hollywood and can be passed in type:

#ADAPTER_FILE:
File, directory, and filesystem adapters. They are used to open files, directories and handle filesystem operation. They can be passed to all functions that deal with files.

#ADAPTER_NETWORK:
Network adapters. They can be used to replace Hollywood's inbuilt network handler. Functions that support network adapters include OpenConnection() and DownloadFile().

#ADAPTER_SERIALIZE:
Serializer adapters. They are used to serialize and deserialize data. Functions that support serializer adapters are SerializeTable() and DeserializeTable() among others.

The default adapter for all the adapter types listed above is default which means that plugin adapters will always be asked before Hollywood's inbuilt handlers.

The string you pass in adapter$ can contain one or more adapters. If several adapters are specified, they must be separated by | characters. See Loaders and adapters for details.

Inputs
type
adapter type to use (see above for possible values)
adapter$
new default for the specified adapter
Example
SetDefaultAdapter(#ADAPTER_FILE, "inbuilt")
OpenFile(1, "test.txt")
The code above will set the default file adapter to inbuilt. This means that all Hollywood functions that deal with files will no longer support any plugin file adapters because you've told Hollywood to only use the inbuilt file adapter.

Show TOC