Difference between revisions of "LSL Portal Style"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
This is a place holder for the [[Talk:LSL_Portal_Style|discussion page]].
This is a place holder for the [[Talk:LSL_Portal_Style|discussion page]].


== Integer constants (hex vs. decimal) ==
== FAQ ==
Questions about how to and why certain things are styled as they are.


:'''Q:''' Why are some constants written in hexadecimal and others in decimal notation?
=== Constants ===
 
:'''Q:''' Why are some integer constants written in hexadecimal and others in decimal notation?
:'''A:''' Patterns. No constant is an island, they all exists within a larger context. Some constants are intended to be OR'ed, some are just simple counting numbers, sometimes the notation can give hints as to how you can manipulate the answer. Some examples:
:'''A:''' Patterns. No constant is an island, they all exists within a larger context. Some constants are intended to be OR'ed, some are just simple counting numbers, sometimes the notation can give hints as to how you can manipulate the answer. Some examples:
:* [[PARCEL_FLAG_USE_ACCESS_LIST]] - Written in hexadecimal to show the pattern of it and it's siblings. In the table they are extra wide to aid in the reading.
:* [[PARCEL_FLAG_USE_ACCESS_LIST]] - Written in hexadecimal to show the pattern of it and it's siblings. In the table they are extra wide to aid in the reading.

Revision as of 15:25, 2 January 2014

This is a place holder for the discussion page.

FAQ

Questions about how to and why certain things are styled as they are.

Constants

Q: Why are some integer constants written in hexadecimal and others in decimal notation?
A: Patterns. No constant is an island, they all exists within a larger context. Some constants are intended to be OR'ed, some are just simple counting numbers, sometimes the notation can give hints as to how you can manipulate the answer. Some examples:
  • PARCEL_FLAG_USE_ACCESS_LIST - Written in hexadecimal to show the pattern of it and it's siblings. In the table they are extra wide to aid in the reading.
  • llSetCameraParams - Written in decimal notation, the flags are consecutively allocated.
  • ERR_GENERIC - Written in hexadecimal as to show that all the bits are turned on, this is to give the hint that you can do ~llSubStringIndex.
  • llParticleSystem is a good example where both notations are used for constants. Different constants used within the function have different relationships.

Old Style Discussions

  1. LSL Category Style - Used for categorizing groups of LSL functions and other Tables of Contents.
  2. LSL Function Style - Used for the full specification of all LSL functions.
  3. LSL Topic Style - Used for topics of interest related to using LSL (XML-RPC, quaternions, etc).
  4. LSL Constants Style - Used for documenting constants.