Difference between revisions of "AGIWiki/discard.view.v"

From ScummVM :: Wiki
Jump to navigation Jump to search
(Created page with "{{AGIWiki}} The '''discard.view.v''' command removes a view resource from memory. There is an direct version of this command called...")
 
m (Text replacement - "<source lang=" to "<syntaxhighlight lang=")
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
{{AGIWiki}}
{{AGIWiki}}
 
{{AGIWiki/Object and View commands}}
The '''discard.view.v''' command removes a [[AGIWiki/View|view resource]] from memory. There is an [[AGIWiki/Indirect command|direct]] version of this command called '''[[AGIWiki/discard.view|discard.view]]'''.
The '''discard.view.v''' command removes a [[AGIWiki/View|view resource]] from memory. There is an [[AGIWiki/Indirect command|direct]] version of this command called '''[[AGIWiki/discard.view|discard.view]]'''.


Line 36: Line 37:
The following example uses <code>discard.view.v</code> to remove view 203 from memory:
The following example uses <code>discard.view.v</code> to remove view 203 from memory:


<syntax type = "C++">
<syntaxhighlight lang="cpp">
  load.view(203);
  load.view(203);
  v100 = 203;
  v100 = 203;
  discard.view.v(v100);
  discard.view.v(v100);
</syntax>
</syntaxhighlight>


== Technical Information ==
== Technical Information ==
Line 56: Line 57:
* [[AGIWiki/discard.view|discard.view]]
* [[AGIWiki/discard.view|discard.view]]
* [[AGIWiki/load.view|load.view]]
* [[AGIWiki/load.view|load.view]]
* [[AGIWiki/load.view.v|load.view.v]]
* [[AGIWiki/load.view|load.view.v]]


== Sources ==
== Sources ==

Latest revision as of 15:13, 25 October 2018

AGIWiki


Object and View Commands

The discard.view.v command removes a view resource from memory. There is an direct version of this command called discard.view.

Syntax

discard.view.v(var viewNumber);

View viewNumber is discarded from memory.

Remarks

Resources must be unloaded in reverse order of the way they were originally loaded, or unexpected results may occur.

Attempting to discard a resource that has not been loaded will generate an error.

Before unloading a view, make certain it is not in use by any active screen objects. If a view is unloaded while still assigned to an object, the interpreter will most likely crash.

AGI adds a script entry to the script stack each time a view resource is unloaded.

Parameters

For discard.view.v

  • viewNumber: a variable, v0-v255, whose value specifies which view resource to remove from memory

Possible errors

Examples

The following example uses discard.view.v to remove view 203 from memory:

 load.view(203);
 v100 = 203;
 discard.view.v(v100);

Technical Information

Required interpreter version Available in all AGI versions
Bytecode value 153 (0x99 hex)

See also

Sources

  • Some of the text in the article is taken from the AGI Studio & WinAGI help files.