Difference between revisions of "Discard.view"
From AGI Wiki
Jump to navigationJump to searchLine 21: | Line 21: | ||
* [[Resources|resources]] must be discarded in exactly the reverse order that they were loaded, or subsequent discard.view commands may generate a [[View Not Loaded Error|view not loaded error]], ''even if the view has actually been loaded''; see [[Memory and Script]] for more details on this issue | * [[Resources|resources]] must be discarded in exactly the reverse order that they were loaded, or subsequent discard.view commands may generate a [[View Not Loaded Error|view not loaded error]], ''even if the view has actually been loaded''; see [[Memory and Script]] for more details on this issue | ||
* the <code>discard.view</code> and <code>discard.view.v</code> commands add to the [[Script Buffer|script buffer]]; this can cause a [[Script Buffer Overflow Error|script buffer overflow error]]. | * the <code>discard.view</code> and <code>discard.view.v</code> commands add to the [[Script Buffer|script buffer]]; this can cause a [[Script Buffer Overflow Error|script buffer overflow error]]. | ||
+ | |||
+ | | ||
== Examples == | == Examples == |
Revision as of 21:06, 2 August 2013
The discard.view command removes a view resource from memory. There is an indirect version of this command called discard.view.v.
discard.view(viewNumber);
View viewNumber
is discarded from memory.
Parameters
For discard.view
viewNumber
: a number, 0-255, specifying which view resource to remove from memory
For discard.view.v
viewNumber
: a variable, v0-v255, whose value specifies which view resource to remove from memory
Possible errors
- if the view is not already loaded, the game will crash with a VIEW not loaded error
- if the view is assigned to an object when it is discarded, the game may crash or exhibit other odd behavior; it may not even generate an error message
- resources must be discarded in exactly the reverse order that they were loaded, or subsequent discard.view commands may generate a view not loaded error, even if the view has actually been loaded; see Memory and Script for more details on this issue
- the
discard.view
anddiscard.view.v
commands add to the script buffer; this can cause a script buffer overflow error.
Examples
The following example uses discard.view
to remove view 203 from memory:
load.view(203);
discard.view(203);
The next example uses discard.view.v
to accomplish the same task:
load.view(203);
v100 = 203;
discard.view.v(v100);
See also
Sources
Some of the text in the article is taken from the AGI Studio help file.