-
Notifications
You must be signed in to change notification settings - Fork 6
Functions
fabiantheblind edited this page Oct 12, 2012
·
2 revisions
/*
To keep your code tidy you can put code pieces
together in a function. You can use them more than one time.
Like this
*/
main();
// the main code
function main () {
var a_string = "Uh. I really want to know how many characters are in me!";
var res = calc_str_length (a_string);
alert(res);
var b_string = "lets see how many characters I have!";
res = calc_str_length (b_string);
alert(res);
// you dont need this return thing here
// but it is cleaner that way
// also have a look at the ESTK console
return 0;
}
// the calc function
function calc_str_length(str){
var l = str.length;
return l;
}
This wiki is maintained by:
fabiantheblind
Collaborators:
- How To Install And Run Scripts
- References And Links
- Tools
- First Session
- Comments
- Extended JavaScript Guide
- Variables And Operations
- Conditionals
- Arrays
- Output And Interaction
- Objects
- Classes
- Loops
- Functions
- Recursive Functions
- The ID Scripting DOM
- ExtendScript
- Inspect Properties
- app
- Documents
- Pages And Margins
- Masterspreads
- Layers
- GeometricBounds and Coordinates
- Text
- Line Feeds And Carrige Returns
- Simple Find And Change Grep
- Simple Find And Change Text
- Text Analysis
- Text Analysis ID FC
- Text Find Locations
- InsertionPoints
- Styles
- Objectstyles
- Rectangles Ovals Polygons
- Matrix
- Outlines Groups Alignment
- Graphic Lines
- Spiro
- Colors And Swatches
- HSL Color Wheel
- Pathfinder
- Fonts
- Transformation Matricies
- Duplicate And Transform
- Includes
- Storing Data In A Target Engine
- Create And Read Files
- Read In JSON From File And Eval
- Delay And View
- ScriptUI Resource Strings