Biferno Language Guide

Tabasoft S.a.s.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled Appendix 4, GNU Free Documentation License.


Table of Contents

1. Quick Guide
1. Introduction
1. What is Biferno?
2. Main Language Features
3. Which Platforms are Supported by Biferno?
4. bifernoadmin
2. Documentation
1. Online Documentation
2. Goal and Conventions of this Document
2. Language Structure
3. Hello World!
4. Identifiers, Types, Objects and Classes
1. The IsDef and Undef Methods
5. Predefined Classes
1. Primitive Classes
1.1. The ansi Class
1.2. The array Class
1.3. The file and folder Classes
1.4. The time Class
1.5. The db and search Classes
1.6. The error Class
2. Internet-Specific Classes
6. Arrays
1. Array Indices
2. Array Initialization
3. Adding and Deleting Array Elements
4. Array Concatenation
5. Subarray Extraction
6. Multidimensional Arrays
7. Array Conversion to Strings
8. Array Sorting and Inversion
9. Other Methods of the Array Class
7. Operators and Expressions
1. Arithmetic Operators
2. Logical Operators
3. Bit-Wise Operators
4. Expressions
5. Implicit Type Casting Rules
8. Control Structures
1. Conditional Execution: The If Instruction
2. The Switch Instruction
3. The For Loop
4. The While Loop
5. The Do-While Loop
6. The Break, Stop and Exit Instructions
7. The Continue Instruction
8. The Include Instruction
9. The Goto Instruction
10. The Lock and Unlock Instructions
9. Applications and Variable Scope
1. Applications
2. Application Variables
3. Reloading and Flushing Biferno
4. Local Variables
5. Global Variables
6. Persistent Variables
7. Session Variables
8. Communication between Applications
10. Functions
1. Function Declaration
2. Application and Local Functions
3. Function Execution: the Return Instruction
4. Passing Parameters to a Function
5. Recursion
11. User classes
1. Class Definition
2. Class Extension
3. Special Methods
3.1. The SetProperty Method
3.2. The SuperIsChanged Method
3.3. The Clone Method
3.4. The Operation Method
3.5. The Compare Method
3.6. The GetErrMessage Method
4. Implicit Conversion Methods
5. The Obj Abstract Class and Method Overloading
3. Built-In Characteristics and Functionality
12. String Manipulation
1. String Comparison
1.1. The Compare Method
1.2. The ansi.strcmp method
2. String Search within a String Set
3. Substring Search
3.1. The Contains Method
3.2. The ansi.strstr Method
3.3. Searching at the Beginning or the End
3.4. Position of a Substring
3.5. The IsEMail Method
3.6. The IsDate Method
3.7. The IsNumeric Method
4. String Transformation
4.1. Highlighting Substrings
4.2. Character Case Modification
4.3. Substring Extraction
4.4. Substring Insertion and Elimination
4.5. Replacement
4.6. String to Array Conversion
4.7. Addition of Characters (Padding)
4.8. Removing Superfluous Space
5. String Encoding and Decoding
5.1. ISO 8859-1 Format Encoding
5.2. Encoding of Special Characters in a URL
6. Number to String Conversion
7. The Eval Function
13. File Management
1. Pathname Conventions
2. Creating and Opening Files
3. Input/Output Operations on Text Files
3.1. Writing Data in a File
3.2. Reading Data from a File
4. Renaming, Moving, Copying, and Deleting A File
4.1. Renaming a File
4.2. Moving a File
4.3. Copying a File
4.4. Deleting a File
5. Directory Operations
5.1. Creating a New Directory
5.2. Deleting a Directory
5.3. Renaming a Directory
5.4. Operations on the Content of a Directory
6. Alias Management
7. Modifying File and Directory Attributes
8. Other Properties of the File and Folder Classes
14. Date and Time Functionality
1. "Time Zero"
2. Date and Time Operations
3. Date and Time Formatting
15. Database Interaction
1. Database Connection
2. Direct Execution of an SQL Query
3. Processing the Result of an SQL Query
3.1. Modifying Cursor Position
3.2. Cursor Deletion
4. Preparation and Execution of SQL Queries
4.1. Dynamic Construction of SQL Strings
4.2. Using Parametric SQL Queries
5. Transactions
6. The Search Class
6.1. Search Class Properties
6.2. Construction of SQL Queries Using the ToSQL Method
16. Error Handling and Debugging
1. Error Messages
1.1. Emailing Errors to the Developer
2. Error Types in Biferno
3. How to Catch and Manage Error Conditions
4. How to Force an Error Condition
5. The Debug Instruction
6. User Class Errors
4. Developing Web Applications with Biferno
17. HTML Integration
1. Output Handling
2. Page Flow Control
3. Dynamic Generation of HTML Code
4. Modularization
5. Biferno and JavaScript
18. Passing Parameters between Pages
1. The HTTP Protocol: GET and POST Methods
2. Passing Parameters via a URL (GET Method)
2.1. Passing an Array in a URL
3. Passing Parameters via a HTML Form (POST Method)
3.1. Passing an Array in a HTML Form
3.2. Passing Data with the "multipart/form-data" Encoding
19. E-mail Handling
1. Sending an Email Message
2. Sending Email Asynchronously
3. Managing an Email Queue
20. HTTP Protocol Interaction
1. The header Class
2. The httpPage class
2.1. Remote Execution of Internet Resources
3. The request and client Classes
3.1. The request Class
3.2. The client Class
4. Cookie Management
4.1. What Are Cookies and What Are They Good For?
4.2. Setting and Reading Cookies in a Biferno Script
21. Access Control
1. Application Protection
1.1. Image Protection
2. Authentication
22. Cache Management
1. Cache Activation and Deactivation
2. Cache Manipulation and cacheItem class
5. Appendices
1. Advanced Configuration
2. Executing and Scheduling Local Scripts
1. Linux and MacOSX
2. Windows
3. MacOS Classic
3. Complete Preferences Listing
1. Biferno.config.bfr
4. GNU Free Documentation License

List of Figures

16.1. Error description screen (developer version)
16.2. Error description screen (user version)
16.3. A sample error from a predefined Biferno class

List of Tables

7.1. Arithmetic Operators
7.2. Logical Operators
7.3. Arithmetic Operators
7.4. Arithmetic Operators
7.5. Precedence of Primitive Classes for Implicit Type Casting
13.1. File class: Possible values of the openMode parameter
13.2. Folder class: Possible values of the openMode parameter
13.3. File class: Predefined constants for file and directory access permissions on Linux
14.1. Format descriptors for the Strftime method
15.1. Structure of the users table
15.2. Connecting via Native Drivers
15.3. Operators supported by the search class in search strings
3.1. Biferno Configuration File Variables