Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,2 +1,20 @@
a = 1 # Here we declare a numeric variable
fruit = "banana" # Here we declare a string datatype
BEGIN {
# Variables are dynamically typecast, and do not need declaration prior to use:
fruit = "banana" # create a variable, and fill it with a string
a = 1 # create a variable, and fill it with a numeric value
a = "apple" # re-use the above variable for a string
print a, fruit
# Multiple assignments are possible from within a single statement:
x = y = z = 3
print "x,y,z:", x,y,z
# "dynamically typecast" means the content of a variable is used
# as needed by the current operation, e.g. for a calculation:
a = "1"
b = "2banana"
c = "3*4"
print "a,b,c=",a,b,c, "c+0=", c+0, 0+c
print "a+b=", a+b, "b+c=", b+c
}