-
-
Notifications
You must be signed in to change notification settings - Fork 24
OSL ‐ Variables
Mistium edited this page Nov 7, 2023
·
11 revisions
-
variablename = "assign-data":
- This command sets a variable with the specified name (
variablename) to the inputted data ("assign-data"). - Example:
count = 10sets the variablecountto the value10. - Setting a variable to an array:
array = ["hello","world"]sets the variablearrayto the value["hello","world"]
- This command sets a variable with the specified name (
-
list.[itemnumber] = "assign-data":
- This command sets the selected item of a list (specified by
[itemnumber]) to the inputted data ("assign-data"). - Example:
mylist.[2] = "new_value"sets the third item in the listmylistto the value"new_value".
- This command sets the selected item of a list (specified by
-
object.key("key") = "assign-data":
- This command sets the selected key of a JSON object (specified by
"key") to the inputted data ("assign-data"). - Example:
myobject.key("name") = "John"sets the value associated with the key"name"in the JSON objectmyobjectto"John".
- This command sets the selected key of a JSON object (specified by
-
variable += 10:
- This code appends ten to the end of a string or adds ten to a number data type.
- Example:
count += 5would increment the value of the variablecountby 5.
-
variable *= 5:
- Sets the variable to itself multiplied by 5. This operation works only on number data types.
- Example:
total *= 2would double the value of the variabletotal.
-
variable /= 5:
- Sets the variable to itself divided by 5. This operation works only on number data types.
- Example:
price /= 2would halve the value of the variableprice.
-
variable -= 5:
- Sets the variable to itself minus 5. This operation works only on number data types.
- Example:
balance -= 10would subtract 10 from the value of the variablebalance.
These commands and modifiers allow you to manipulate variables, lists, and JSON objects, performing assignments and arithmetic operations as needed in your script.
originOS is a web desktop gui with a self contained file system, programming languages, internet system and a whole lot of stuff an os should be able to do Use originOS here