Specified Slot Number Was Invalid
An invalid HANDLE was specified. C0000009: STATUSBADINITIALSTACK: An invalid initial stack was specified in a call to NtCreateThread. C000000A: STATUSBADINITIALPC: An invalid initial start address was specified in a call to NtCreateThread. C000000B: STATUSINVALIDCID: An invalid client ID was specified. C000000C: STATUSTIMERNOTCANCELED. I'm having the weirdest bug. I can't throw items away (when I try to it says 'Slot Number is Invalid'). When I try to sell items in the store, it simply won't allow it.
slot {methods} | R Documentation |
The Slots in an Object from a Formal Class
Description
Specified Slot Number Was Invalid May
These functions return or set information about the individual slotsin an object.
Usage
Arguments
object | An object from a formally defined class. |
name | The name of the slot. The operatortakes a fixed name, which can be unquoted if it is syntactically aname in the language. A slot name can be any non-empty string, butif the name is not made up of letters, numbers, and In the case of the |
value | A new value for the named slot. The value must bevalid for this slot in this object's class. |
check | In the replacement version of |
x | either the name of a class (as character string), or a classdefinition. If given an argument that is neither a character stringnor a class definition, |
Details
The definition of the class specifies all slots directly andindirectly defined for that class. Each slot has a name and anassociated class. Extracting a slot returns an object from thatclass. Setting a slot first coerces the value to the specified slotand then stores it.
Unlike general attributes, slots are not partially matched, and askingfor (or trying to set) a slot with an invalid name for that classgenerates an error.
The @
extraction operator and slot
function themselves do no checking against the class definition,simply matching the name in the object itself.The replacement forms do check (except for slot
in the casecheck=FALSE
). So long as slots are set without cheating, theextracted slots will be valid.
Be aware that there are two ways to cheat, both to be avoided butwith no guarantees. The obvious way is to assign a slot withcheck=FALSE
. Also, slots in R are implemented asattributes, for the sake of some back compatibility. The currentimplementation does not prevent attributes being assigned, viaattr<-
, and such assignments are not checked forlegitimate slot names.
Note that the '@'
operators for extraction and replacement areprimitive and actually reside in the base package.
The replacement versions of '@'
and slot()
differ inthe computations done to coerce the right side of the assignment tothe declared class of the slot. Both verify that the value providedis from a subclass of the declared slot class. The slot()
version will go on to call the coerce method if there is one, ineffect doing the computation as(value, slotClass, strict = FALSE)
. The '@'
version just verifies the relation,leaving any coerce to be done later (e.g., when a relevant method isdispatched).
In most uses the result is equivalent, and the '@'
versionsaves an extra function call, but if empirical evidence shows that aconversion is needed, either call as()
before the replacementor use the replacement version of slot()
.
Value
The '@'
operator and the slot
function extract orreplace the formally defined slots for the object.
Functions slotNames
and getSlots
return respectively thenames of the slots and the classes associated with the slots in thespecified class definition. Except for its extended interpretation ofx
(above), slotNames(x)
is just names(getSlots(x))
.
Specified Slot Number Was Invalid Due
References
Chambers, John M. (2008)Software for Data Analysis: Programming with RSpringer. (For the R version.)
Chambers, John M. (1998)Programming with DataSpringer (For the original S4 version.)
See Also
@
,Classes_Details
,Methods_Details
,getClass
,names
.