Skip to content

Variables

Rodrigo Cabaço edited this page Mar 22, 2021 · 2 revisions

In order to store a value, we will need a variable.
A variable is a numeric or string (word / phrase / char) value.

  • In rC we have 2 types of variables:

str

A string (defined by str in rC) is a word / phrase / char value.
Examples: "Hello, This is a string", "Hi", "H"

  • Declaring a string
    To declare a string just use: str name >>"value" --> this delcares a str with the name "name" and the value "value" ^ ^ ^
    type name value
    We can also declare another value to a string such as readkey, readline.
    Examples: str me >>$readline, str me >>$readkey

To add a string to another just do:
str f >>"12"
str g >>"34"
str (f+g) -> this will add the value of g to f (f = f+g) = 1234
str (g+f) -> this will ad the value of f to g (g = g+f) = 3412

number or num

A number is defined as a string but instead of str h >>12, just use num x >>12 or num h >>12
The advantage of a num is you can do operations with it.
Ex:
num h >> 50
h + 30
#h is now 50 + 30 = 80
num g >> 20
h+g
#now h = h+g = 100

Clone this wiki locally