[SparForte][Banner]
[Top Main Menu] Intro | Tutorials | Reference | Packages | Examples | Contributors   [Back Page]      [Next Page]  

Command Reference

Here is a list of the AdaScript built-in commands and statements. Commands found in the built-in packages are documented in Part 4.

begin

see declare

case

Syntax: case var is when constant|literal => ... when others => ... end case
Description: Test a variable for multiple values. "when others" case is required.

cd

Syntax: cd - | dirname
Description: change directory. "-" is the previous directory.  A leading '~' is your home directory.

clear

Syntax: clear
Description: reset tty device and clear the screen

close

Syntax: close( file )
Description: close an open file

command [prior to Bush 1.0]

Syntax: command cmd
Description: run a Linux command (instead of a built-in command).

create

Syntax: create( file [, out_file | append_file] [, path ] )
Description: create - create a new file or overwrite an existing file. The default type is out_file. The default path a temporary file name.

declare

Syntax: [declare declarations] begin ... end
Description: begin a new block

delay

Syntax: delay secs
Description: wait (sleep) for a specific time

delete

Syntax: delete( file )
Description: close and delete a file

end_of_file

Syntax: end_of_file( file )
Description: true if an in_file file has no more data

end_of_line

Syntax: end_of_line( file )
Description: true if an in_file file has reached the end of a line with get

else

see if

elsif

see if

env

Syntax: env or env identifier or env (identifier)
Description: show a table of all identifiers, or identify an identifier or keyword.

exit

Syntax: exit | exit when condition
Description: break out of a loop

for

Syntax: for var in [reverse] first..last loop ... end loop
Description: for loop - loop through between first and last assigning value to var. The for starts a new block and the for variable is automatically declared based on the type of first.

get

Syntax: get( [file,] var )
Description: read a character from a line of text.

get_line

Syntax: var := get_line [ (file) ]
Description: read a line of text

history

Syntax: history -c | history [n]

Show or clear the interactive command history.  If n, show the n most recent interactive commands.

if

Syntax: if expression then ... [elsif expr then ...] [ else ...]
Description: conditional execution

inkey

Syntax: c := inkey
Description: read a character from standard input without echoing

is_open

Syntax: is_open( file )
Description: true if file is open

jobs

Syntax: jobs
Description: list status of current background jobs

line

Syntax: line( file )
Description: the number of read/written lines

logout

Syntax: logout
Description: terminate an interactive login session

loop

syntax: loop ... end loop
Description: General loop. exit with an exit statement.

mode

Syntax: mode( file )
Description: the file mode (in_file, out_file, append_file)

name

Syntax: name( file )
Description: name of an open file

new_line

Syntax: new_line [(file)]
Description: start a new line

null

Syntax: null
Description: do nothing

open

Syntax: open( file, in_file | out_file | append_file, path )
Description: open an existing file or open a socket

pragma

interpreter directive

put

Syntax: put ( [file], expression [, picture] )
Description: write to output, no new line. If picture is included, format the number according to the picture.

put_line

Syntax: put_line ( [file], expression )
Display: write to output and start new line

pwd

Syntax: pwd
Description: present working directory

reset

Syntax: reset( file [,mode]
Description: reopen a file

return

Syntax: return [status code]
Description: exit script and return status code

set_input

Syntax: set_input( file ), set_output( file ), set_error( file )
Description: input/output redirection

skip_line

Syntax: skip_line [(file)]
Description: discard the next line of input

subtype

Syntax: subtype newtype is oldtype
Description: create an alias for a type

system

Syntax: system( commandstring )
Description: run a BASH shell command

trace

Syntax: trace [true | false]
Description: show verbose debugging information

typeset

Syntax: typeset var [is type]
Description: change the type of a variable, declaring it if necessary. Cannot be used in scripts or with pragma ada_95.

unset

Syntax: unset ident or unset (ident)
Description: delete an identifier. Cannot be used in scripts or with pragma ada_95.

wait

Syntax: wait
Description: wait for all background commands to finish.

while

Syntax: while condition loop ... end loop
Description: while loop - repeat the loop until the condition is false

?

Syntax: ? expression
Description: put_line to standard output. Cannot be used with pragma ada_95.

[Right Submenu]

 AdaScript versus GCC

 Case Sensitivity

 Reserved Words

 Comments

 Literals

 Bourne Shell Word Expansions

 Fundamental Types

 User-defined Types

 Enumerated Types

 Arrays

 Records

 Basic Assignment

 The @ and % Operands

 Command Argument Shortcuts

 Redirection and Pipelines

 Command Line Interaction

 Built-in Shell Commands

 The Current Directory

 Database Commands

 Flow of Control

 Other Statements/ Subprograms

 External Commands

 Block Statements and Subprograms

 TCP/IP Sockets

 Numeric Formatting with Put

 Interpreter Directives

 Command Line Options

 Command Reference

 ASCII and Latin_1 Character Sets

 Common Error Messages

 Common PHP Functions and the SparForte Equivalent

[Back to Top] Back To Top [Small Forte Symbol]