Vp int: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
Sleepy E (talk | contribs)
mNo edit summary
Sleepy E (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
|paramex=attr
|paramex=attr
|parameters=
|parameters=
   {{sdk parameter row|vp_int_attribute_t|attr|Attribute to return value of}}
   {{sdk parameter row|vp_int_attribute_t|attr|Attribute to return value of (defined in VP.h)}}
|returns=
|returns=
  integer
The value of the attribute.
|returnattributes=
|behavior=If an invalid identifier is passed for <i>attr</i>, then 0 will be returned.
  {{sdk attribute row|type|name|description}}
|caveats=There is no way to know if the call was unsuccessful, use {{sdk method|int_get}} when this is required.
|behavior=
|caveats=If an invalid value is passed for attr, then 0 will be returned.
|examples=
|examples=
<syntaxhighlight lang="c">
  printf("My owner is user id #%d\n", vp_int(sdk, VP_MY_USER_ID));
</syntaxhighlight>
|seealso=
|seealso=
* {{sdk method|int_get}}
* {{sdk method|int_set}}
* {{sdk method|int_set}}
}}
}}

Latest revision as of 22:10, 13 December 2016

Method call snippet vp_int(instance, attr);

Return the value of an integer attribute.

Parameters

These are the parameters that this method requires:

Parameter Usage
VPInstance
instance
Pointer to the instance this method call is intended for
vp_int_attribute_t
attr
Attribute to return value of (defined in VP.h)

Returns

The value of the attribute.

Behavior

If an invalid identifier is passed for attr, then 0 will be returned.

Caveats

There is no way to know if the call was unsuccessful, use vp_int_get() when this is required.

Examples

  printf("My owner is user id #%d\n", vp_int(sdk, VP_MY_USER_ID));

See also