mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Updated documents (mainly array functions)
This commit is contained in:
+11
-11
@@ -212,17 +212,6 @@ _*mixed means any type_
|
||||
- returns number of elements or key=>value pairs in a given array
|
||||
- if array is not found, returns -1 (can be used to check if given array exist)
|
||||
|
||||
* `mixed array_key(int arrayID, int index)`:
|
||||
- don't use it directly; it is generated by the compiler in foreach loops
|
||||
- for lists, returns index back (no change)
|
||||
- for maps, returns a key at the specified numeric index (don't rely on the order in which keys are stored though)
|
||||
- can be checked if given array is associative or not, by using index (-1): 0 - array is list, 1 - array is map
|
||||
|
||||
* `int arrayexpr(mixed key, mixed value)`:
|
||||
- don't use it directly; it is used by compiler to create array expressions
|
||||
- assigns value to a given key in an array, created by last `create_array` or `temp_array` call
|
||||
- always returns 0
|
||||
|
||||
* `void save_array(mixed key, int arrayID)`:
|
||||
- makes the array saveable; it will be saved in **sfallgv.sav** file when saving the game
|
||||
- arrayID is associated with given "key"
|
||||
@@ -234,6 +223,17 @@ _*mixed means any type_
|
||||
- loads array from savegame data by the same key provided in `save_array`
|
||||
- returns array ID or zero (0) if none found
|
||||
|
||||
* `mixed array_key(int arrayID, int index)`:
|
||||
- don't use it directly; it is generated by the compiler in foreach loops
|
||||
- for lists, returns index back (no change)
|
||||
- for maps, returns a key at the specified numeric index (don't rely on the order in which keys are stored though)
|
||||
- can be checked if given array is associative or not, by using index (-1): 0 - array is list, 1 - array is map
|
||||
|
||||
* `int arrayexpr(mixed key, mixed value)`:
|
||||
- don't use it directly; it is used by compiler to create array expressions
|
||||
- assigns value to a given key in an array, created by last `create_array` or `temp_array` call
|
||||
- always returns 0
|
||||
|
||||
## Backward compatibility notes
|
||||
|
||||
For those who used arrays in their mods before sfall 3.4:
|
||||
|
||||
Reference in New Issue
Block a user