Drop

From AGI Wiki
Revision as of 12:48, 30 March 2019 by Andrew Korson (talk | contribs) (Created page with "The '''drop''' command changes an inventory item's room number to zero. == Syntax == drop(itm iA); drop("item"); == Remarks == The '''drop''' comman...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The drop command changes an inventory item's room number to zero.

Syntax

drop(itm iA); drop("item");

Remarks

The drop command is essentially a shortcut equivalent to using the put command with a new room number value of zero.

Note that there is not an equivalent 'variable' version of the drop command (i.e. no drop.v that takes a variable as an argument.)

Possible Errors

If the inventory item is not valid (the number exceeds the total number of inventory items in the OBJECT file), AGI will raise trappable error #23.

Example

Code:
drop(i30);   [ item 30's room number is now 0 
put(i30, 0); [ this also 'drops' an item

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 94 (0x5E hex)

See Also

Inventory Item Commands
put
put.v