chapter 4 Flashcards
script
sequence of statements stored in a file
simple form of program
executed line by line top to bottom
live script editor
used to create .mlx script
1) define and italicize variables
2) run script from command window
3) script reads and modifies variables in base workspace
4) variables can be modes from command line or within the script
whos
shows all variables and more Information about them (size, bytes)
comment
text added for explanation of program
%
single line comment, interpreter ignores the text right of % on that line
block comment
when multiple lines needed, start with
%{ and end with %}
operators should be on their own lines
whitespace
blank lines that make code easier to read, good practice for style
help comments
comment before beginning of script file that explains what’s happening
custom function
list of statements programmer creates and gives specific name
inputs
variables or values you put into function
outputs
variables or values that you calculate with functionfn
function call
reference to functions name
passing
providing input values during function calla
arguments
values
local variable
variable created inside function that doesn’t exist outside of it
function call to assign values
values assigned are called arguments and can be multiple w/ commas or arrays
function( argument)
local function
functions stored at end of script
advantage of local function
share script between users is simplified
disadvantage of local functions
local function in one script can’t be accessed by other scripts, can’t be called from command
function workspace
temporary area where functions perform all calculations
callstack
another word for function workspace
predefined trig functions
sin, sind (sin in degrees), asin (inverse sin) etc
predefined hyperbolic functions
sinh (hyperbolic sin) asinh (inverse hyperbolic sin)
predefined exponential functions
exp (exponent), log, sqrt, etc