User Tools

Site Tools


script:walkthrough:statements_and_compounds

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
script:walkthrough:statements_and_compounds [2019-11-20 19:26]
skyjake [Flow control]
script:walkthrough:statements_and_compounds [2019-11-20 19:30] (current)
skyjake [Assignment]
Line 84: Line 84:
   array[1] = 10   array[1] = 10
   # origArray remains unmodified   # origArray remains unmodified
 +
 +==== Weak assignment ====
  
 Weak assignment ''?​=''​ only creates new variables. It never modifies existing ones. Weak assignment ''?​=''​ only creates new variables. It never modifies existing ones.
Line 102: Line 104:
   $ print 'z =', z   $ print 'z =', z
   z = 3   z = 3
 +
 +==== const ====
  
 You can use the ''​const''​ keyword when assigning to create a read-only variable. You can use the ''​const''​ keyword when assigning to create a read-only variable.
Line 125: Line 129:
   Have to delete z before its value can change.   Have to delete z before its value can change.
  
 +==== del ====
  
 Variables and functions can be deleted with the ''​del''​ keyword. Variables and functions can be deleted with the ''​del''​ keyword.
script/walkthrough/statements_and_compounds.txt ยท Last modified: 2019-11-20 19:30 by skyjake