    

 ## On this page

  

 

 # FileVariable

 Last update: 16.07.2025 

public class [FileVariable](index.md) : [Variable](../-variable/index.md)

A variable type class for ModelCenter

#### Author

Woyak, 10/2001

## Functions

NameSummary[dependentLinks](../-variable/dependent-links.md)public [dependentLinks](../-variable/dependent-links.md)(): [VariableLinks](../-variable-links/index.md)  
Returns a list of links that immediately depend on the value of this variable.[disableGC](../../com.phoenix_int.ModelCenter.util/-p-h-x-c-o-m-object/disable-g-c.md)public [disableGC](../../com.phoenix_int.ModelCenter.util/-p-h-x-c-o-m-object/disable-g-c.md)(gc: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html))  
If true, prevents releaseObjects from doing anything.[fromFile](from-file.md)public [fromFile](from-file.md)(fileName: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
reads data from a file (same as readFile()).[fromString](../-variable/from-string.md)public [fromString](../-variable/from-string.md)(str: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
Sets the value for the variable from a string.[getDescription](get-description.md)public [getDescription](get-description.md)(): [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)  
gets the description text for the file[getDirectDependents](../-variable/get-direct-dependents.md)public [getDirectDependents](../-variable/get-direct-dependents.md)(): [Variables](../-variables/index.md)  
public [getDirectDependents](../-variable/get-direct-dependents.md)(followSuspended: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)): [Variables](../-variables/index.md)  
Gets all the immediately linked outputs of this variable.[getDirectPrecedents](../-variable/get-direct-precedents.md)public [getDirectPrecedents](../-variable/get-direct-precedents.md)(): [Variables](../-variables/index.md)  
public [getDirectPrecedents](../-variable/get-direct-precedents.md)(followSuspended: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)): [Variables](../-variables/index.md)  
Gets all the immediately linked inputs of this variable.[getDirectTransfer](get-direct-transfer.md)public [getDirectTransfer](get-direct-transfer.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)  
Gets the directTransfer flag.[getFileExtension](get-file-extension.md)public [getFileExtension](get-file-extension.md)(): [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)  
gets the extension used for the file (used to associate the file with an application).[getFullName](../-variable/get-full-name.md)public [getFullName](../-variable/get-full-name.md)(): [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)  
Gets the full name of the variable, e.g.[getHasChanged](../-variable/get-has-changed.md)public [getHasChanged](../-variable/get-has-changed.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)  
Boolean which indicates if the variable has changed since the last time the boolean was reset.[getHide](../-variable/get-hide.md)public [getHide](../-variable/get-hide.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)  
Gets whether the variable is hidden or not[getIsBinary](get-is-binary.md)public [getIsBinary](get-is-binary.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)  
gets a flag indicating if the file contents are binary[getMetadata](../-variable/get-metadata.md)public [getMetadata](../-variable/get-metadata.md)(name: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)): [Variant](../-variant/index.md)  
Get a metadata value.[getName](../-variable/get-name.md)public [getName](../-variable/get-name.md)(): [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)  
Gets the name of the variable, e.g.[getOwningComponent](../-variable/get-owning-component.md)public [getOwningComponent](../-variable/get-owning-component.md)(): [Component](../-component/index.md)  
Get the component which owns this variable.[getSaveWithModel](get-save-with-model.md)public [getSaveWithModel](get-save-with-model.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)  
Gets a flag indicating that the value of the file should be saved with the model.[getType](../-variable/get-type.md)public [getType](../-variable/get-type.md)(): [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)  
Gets the type of the variable.[invalidate](../-variable/invalidate.md)public [invalidate](../-variable/invalidate.md)()  
Invalidates the variable[isInput](../-variable/is-input.md)public [isInput](../-variable/is-input.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)  
Indicates whether the variable is an input or output[isInputToComponent](../-variable/is-input-to-component.md)public [isInputToComponent](../-variable/is-input-to-component.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)  
Indicates whether a variable is an input to a component[isInputToModel](../-variable/is-input-to-model.md)public [isInputToModel](../-variable/is-input-to-model.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)  
Indicates whether a variable is an input to the Model[isValid](../-variable/is-valid.md)public [isValid](../-variable/is-valid.md)(): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)  
Indicates whether the variable is currently valid or not[precedentLinks](../-variable/precedent-links.md)public [precedentLinks](../-variable/precedent-links.md)(): [VariableLinks](../-variable-links/index.md)  
Returns a list of links that are immediate precedents to the value of this variable.[readFile](read-file.md)public [readFile](read-file.md)(fileName: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
reads data from a file (same as fromFile()).[release](../../com.phoenix_int.ModelCenter.util/-p-h-x-c-o-m-object/release.md)public [release](../../com.phoenix_int.ModelCenter.util/-p-h-x-c-o-m-object/release.md)()  
Releases the COM reference to ModelCenter for this object.[releaseObjects](../../com.phoenix_int.ModelCenter.util/-p-h-x-c-o-m-object/release-objects.md)public [releaseObjects](../../com.phoenix_int.ModelCenter.util/-p-h-x-c-o-m-object/release-objects.md)()  
This function attempts to release any COM resources left behind from objects which have been finalized but release() was never called on them.[setDescription](set-description.md)public [setDescription](set-description.md)(desc: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
sets the description text for the file[setDirectTransfer](set-direct-transfer.md)public [setDirectTransfer](set-direct-transfer.md)(flag: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html))  
Sets the directTransfer flag.[setFileExtension](set-file-extension.md)public [setFileExtension](set-file-extension.md)(ext: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
sets the desired file extension for the file[setHasChanged](../-variable/set-has-changed.md)public [setHasChanged](../-variable/set-has-changed.md)(flag: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html))  
Boolean which indicates if the variable has changed since the last time the boolean was reset.[setHide](../-variable/set-hide.md)public [setHide](../-variable/set-hide.md)(flag: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html))  
Set whether the variable is hidden or not[setIsBinary](set-is-binary.md)public [setIsBinary](set-is-binary.md)(flag: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html))  
sets a flag indicating that this variable contains binary data[setMetadata](../-variable/set-metadata.md)public [setMetadata](../-variable/set-metadata.md)(name: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), type: [Variable.MetadataType](../-variable/-metadata-type/index.md), value: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html), access: [Variable.MetadataAccess](../-variable/-metadata-access/index.md), archive: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html))  
Set a metadata value on a variable.[setReferenceDebugMode](../../com.phoenix_int.ModelCenter.util/-p-h-x-c-o-m-object/set-reference-debug-mode.md)public [setReferenceDebugMode](../../com.phoenix_int.ModelCenter.util/-p-h-x-c-o-m-object/set-reference-debug-mode.md)(on: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html))  
When set to true, the system will keep a list of active COM objects that are allocated but not yet released since this method was invoked.[setSaveWithModel](set-save-with-model.md)public [setSaveWithModel](set-save-with-model.md)(flag: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html))  
Sets a flag indicating that the value of the file should be saved with the model.[toFile](to-file.md)public [toFile](to-file.md)(fileName: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
public [toFile](to-file.md)(fileName: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), encoding: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
writes out contents to a file (same as writeFile()).[toFileAbsolute](to-file-absolute.md)public [toFileAbsolute](to-file-absolute.md)(fileName: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
writes out contents to a file without validating the variable (same as writeFile()).  
public [toFileAbsolute](to-file-absolute.md)(fileName: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), encoding: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
writes out contents to a file without validating the variable.[toString](../-variable/to-string.md)public [toString](../-variable/to-string.md)(): [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)  
Converts the variable value to a string representation.[toStringAbsolute](../-variable/to-string-absolute.md)public [toStringAbsolute](../-variable/to-string-absolute.md)(): [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)  
Converts the variable value to a string representation.[validate](../-variable/validate.md)public [validate](../-variable/validate.md)()  
Causes the scheduler to get a valid value for this variable.[writeFile](write-file.md)public [writeFile](write-file.md)(fileName: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
writes out contents to a file (same as toFile()).[writeFileAbsolute](write-file-absolute.md)public [writeFileAbsolute](write-file-absolute.md)(fileName: [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))  
writes out contents to a file without validating the variable (same as toFileAbsolute()).