Free scripts

From DrugPedia: A Wikipedia for Drug discovery

Revision as of 08:50, 23 September 2008 by Harinder (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Contents

[edit] What Is a Script?

A script is a set of instructions. The computer executes the instructions, then returns data, a value -- which could be a number, a string, a list, or another data type.

[edit] What is a string?

A string is a type of data: it's zero or more characters, it's a string of text.

[edit] What is a character?

A character is a single letter, digit, space, punctuation, carriage return, tab, or other code. Most characters can be typed via the keyboard.

'A' is a character, '5' is a character, '(' is a character.

"A5(" is a string -- it's three characters in a row.

Characters and strings are just two of the many types of data Frontier supports. These will be explained in more detail later.

The important thing to know is: scripts act on data, and there are many types of data.

A very simple script does nothing but return a value. To return a value, it uses the "return" keyword.

The word "return" is a word that UserTalk understands. It means: return this value to the script that called me.

A very simple script might look like this:

return ("This is a string.")

The return keyword is usually followed by open and close parentheses. What appears between the parentheses is what gets returned.

[edit] Returned Where?

A script is called -- usually by another script. In some cases a script may be called by the Frontier application itself. And of course you can run scripts yourself -- and those scripts may in turn call other scripts.

When a script is called, it runs and returns data to the caller.