Railgun

if it ain't broke, we'll break it

User Tools

Site Tools


senses:globals:sense

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

senses:globals:sense [2025/07/28 03:24] – created flashsenses:globals:sense [2025/07/28 03:29] (current) – args & rets on same level as syntax flash
Line 15: Line 15:
   config(name: string, fallback: any = nil): (value: any)   config(name: string, fallback: any = nil): (value: any)
  
-=== Arguments ===+==== Arguments ====
  
   - The first argument may contain the name of the configuration value, the runtime will likely prepend a prefix or otherwise isolate the storage to prevent the package from values not intended for it.   - The first argument may contain the name of the configuration value, the runtime will likely prepend a prefix or otherwise isolate the storage to prevent the package from values not intended for it.
   - The second argument may contain any arbitrary value that should be returned if the runtime does not have anything to return instead.   - The second argument may contain any arbitrary value that should be returned if the runtime does not have anything to return instead.
  
-=== Return values ===+==== Returns ====
  
   - The first return value will be the configuration value provided by the runtime, or the fallback argument value.   - The first return value will be the configuration value provided by the runtime, or the fallback argument value.
Line 32: Line 32:
   dataPath(name: string|nil = nil): (path: string)   dataPath(name: string|nil = nil): (path: string)
  
-=== Arguments ===+==== Arguments ====
  
   - The first argument may contain an optional string value of a path to be appended to the root data path. This will also normalise the path separators (e.g. use ''\'' instead of ''/'' on Windows).   - The first argument may contain an optional string value of a path to be appended to the root data path. This will also normalise the path separators (e.g. use ''\'' instead of ''/'' on Windows).
  
-=== Return values ===+==== Returns ====
  
   - The first return value will be the root data path, with name argument append if it is a valid path string.   - The first return value will be the root data path, with name argument append if it is a valid path string.
Line 48: Line 48:
   srcPath(name: string|nil = nil): (path: string)   srcPath(name: string|nil = nil): (path: string)
  
-=== Arguments ===+==== Arguments ====
  
   - The first argument is an optional string value of a path to be appended to the source path. This will also normalise the path separators (e.g. use ''\'' instead of ''/'' on Windows). The path MUST exist, otherwise the return value is discarded entirely.   - The first argument is an optional string value of a path to be appended to the source path. This will also normalise the path separators (e.g. use ''\'' instead of ''/'' on Windows). The path MUST exist, otherwise the return value is discarded entirely.
  
-=== Return values ===+==== Returns ====
  
   - The first return value will be the source path, with name argument append if it is an existent path string.   - The first return value will be the source path, with name argument append if it is an existent path string.
Line 68: Line 68:
   get(name: string): (value: any)   get(name: string): (value: any)
  
-== Arguments ==+=== Arguments ===
  
   - The first argument should contain the name of the variable that is to be read.   - The first argument should contain the name of the variable that is to be read.
  
-== Return values ==+=== Returns ===
  
   - The first return value will either be the value stored, or ''nil'' as a fallback.   - The first return value will either be the value stored, or ''nil'' as a fallback.
Line 84: Line 84:
   changed(name: string): (timestamp: number)   changed(name: string): (timestamp: number)
  
-== Arguments ==+=== Arguments ===
  
   - The first argument should contain the name of the variable that is to be dated.   - The first argument should contain the name of the variable that is to be dated.
  
-== Return values ==+=== Returns ===
  
   - The first return value will either be the numeric timestamp, or ''0'' if no value is stored.   - The first return value will either be the numeric timestamp, or ''0'' if no value is stored.
Line 100: Line 100:
   set(name: string, value: any): ()   set(name: string, value: any): ()
  
-== Arguments ==+=== Arguments ===
  
   - The first argument should contain the name of the variable that should be assigned.   - The first argument should contain the name of the variable that should be assigned.
   - The second argument should contain the value that should be stored. If ''nil'', this will behave the same as the delete function.   - The second argument should contain the value that should be stored. If ''nil'', this will behave the same as the delete function.
  
-== Return values ==+=== Returns ===
  
 //This function does not return any values.// //This function does not return any values.//
Line 117: Line 117:
   delete(name: string): ()   delete(name: string): ()
  
-== Arguments ==+=== Arguments ===
  
   - The first argument should contain the name of the variable that is to be deleted.   - The first argument should contain the name of the variable that is to be deleted.
  
-== Return values ==+=== Returns ===
  
 //This function does not return any values.// //This function does not return any values.//
senses/globals/sense.txt · Last modified: by flash