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

Literals

Numbers (numeric literals) can contain a decimal point.  An alternate base (hex, octal, etc.) can be specified by following the base with the value between '#'.  Hexadecimal letter characters can be in upper or lower case.  Scientific notation is not yet supported.

=> ? 16#FFFF#
65535
  • 5 - the numeric value 5
  • 5.0 the numeric value 5.0
  • 8#777# - the octal value 511
  • 16#ff# - the hexadecimal value 255

All numeric literals are of type univeral_numeric.

Characters are enclosed in single quotes. It must be only one character long.

  • 'a' - the character a

Strings are enclosed in double quotes.

  • "hello" - the string hello

All string or character literals are of type universal_string.

Ada: In Ada, the number 5 is an integer and 5.0 is a float. Here they are both universal_numeric. In Ada, "hello" is a string and 'c' is a character. Both are universal_strings here.


 
[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]