Home

 

Quick Start with Elisa  

Using Development System Demo's

 

Language Description

1. Lexical Elements
2. Basic Data Types and Expressions
3. Definitions
4. Streams
5. Backtracking
6. Statements and Special Expressions
7. Arrays

8. Lists
9. Descriptors
10. Components
11. Collections
12. Generic Components
13. Terms
14. Categories
15. Types 

16. Built-in Definitions
17. Higher-order Definitions

18. External Interfaces

Index

Data Structures

1. Sequences
2. Examples involving Lists
3. Trees
4. Graphs
5. Searching State Spaces
6. Language Processing
7. Knowledge Representations          

 

Tutorials

1. Multi-value Functions

2. Lists and Streams

3. Descriptors

4. Trees

 

 

Back Home Up Next


16   BUILT-IN DEFINITIONS

16.1 Increase array

16.2 Truncate array

16.3  Character to text conversion

16.4 Integer to text conversion

16.5 Integer to limited text conversion

16.6 Real to text conversion

16.7 Real to limited text conversion

16.8 Real to formatted text conversion

16.9 Text to integer conversion

16.10 Text to real conversion

16.11 Text to integer test

16.12 Text to real test

16.13 Log operations

A number of definitions are built-in the language.

16.1 Increase array

Signature:  increase(array(entity1), n = integer) -> array(entity1);

The increase function increases the specified array with n empty elements. It returns the increased array.

Example:     increase("ABCD", 3)?     ==>  "ABCD   "

 

16.2 Truncate array

Signature:  truncate(array(entity1), n = integer) -> nothing;

The truncate function truncates the specified array to n remaining elements. It returns nothing.

 

Example:   

        CharArray = "ABCDEFGH";
      truncate(CharArray, 3);
      CharArray?                 ==>  "ABC"

                

16.3  Character to text conversion

Signature:  text(character) -> text;

The text function converts the character to  text. It returns the text.

Example:    text('a')?                ==>  "a"

 

16.4 Integer to text conversion

Signature:  text(integer) -> text;

The text function converts the integer  to  text. It returns the text.

Examples:    text(12345)?              ==>  "12345"

        text(-12345)?             ==>  "-12345"

 

16.5 Integer to limited text conversion

Signature:  text(integer, width = integer) -> text;

The text function converts  integer to text. The size of the text is specifed by the width.

Examples:    text(12345,8)?           ==>  "   12345"

        text(-12345,8)?          ==>  "   -12345"

 

16.6 Real to text conversion

Signature:  text(real) -> text;

The text function converts the real  to  text. It returns the text.

Examples:    text(12345.678)?       ==>  "12345.678"

        text(-12345.678)?      ==>  "-12345.678"

 

16.7 Real to limited text conversion

Signature:  text(real, width = integer) -> text;

The text function converts the real to text in the scientific notation. The size of the text is specifed by the width.

Examples:    text(123.45,12)?        ==>  " 1.2345e+002" 

        text(-123.45,12)?       ==>  "-1.2345e+002"

 

16.8 Real to formatted text conversion

Signature:  text(real, width = integer, fraction = integer) -> text;

The text function converts the real to text. The size of the text is specifed by the width. The size of the fraction is specified by integer value of fraction.

Examples:    text(12345.6789,9,2)?     ==>  " 12345.68"

        text(-12345.6789,9,2)?    ==>  "-12345.68"

 

16.9 Text to integer conversion

Signature:  integer(text) -> integer;

The integer function converts text to an integer value. 

Examples:    integer("12345")?         ==>  12345

        integer("-12345")?        ==>  -12345

 

16.10 Text to real conversion

Signature:  real(text) -> real;

The real function converts text to a real value. 

Examples:    real("12345.678")?       ==>  12345.678

        real("-12345.678")?      ==>  -12345.678

 

16.11 Text to integer test

Signature:  isinteger(text) -> boolean;

The isinteger function examines the text to determine if it is an integer value. If so, the value of the returned boolean value is true, otherwise it is false.

Examples:   

isinteger("12345")?        ==>  true

isinteger("123.45")?       ==>  false

 

16.12 Text to real test

Signature:  isreal(text) -> boolean;

The isreal function examines the text to determine if it is a real value. If so, the value of the returned boolean value is true, otherwise it is false.

Examples:   

isreal("123.45")?        ==>  true 

isreal("123,45")?        ==>  false

 

16.13 Log operations

Log operations are used to write entities to the log file. The built-in log operations are:

 log(text)      -> nothing;

 logln(text)    -> nothing;

 log(entity1)   -> nothing;

 logln(entity1) -> nothing;

 

Top of Page   Part 1: Language Description   Chapter 16: Built-in Definitions

 
            

 

 

  <!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=11338540;
var sc_invisible=0;
var sc_security="f2d7a14f";
var sc_https=1;
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" + scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="Web Analytics Made Easy -
StatCounter" href="http://statcounter.com/" target="_blank"><img
class="statcounter" src="//c.statcounter.com/11338540/0/f2d7a14f/0/"
alt="Web Analytics Made Easy - StatCounter"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->