C Language Development Kit/Snippets

From OptiWiki

Jump to: navigation, search

Starting a new program from scratch is the most difficult thing about programming. Even with a very good documented programming manual the first application is the most difficult. That is why some commonly used functions that have been tested over the years are put in this snippets section. The snippets are ANSI C snippets. Also the functions from the Opticon C-Library are clickable to get more information about the specific function. The functions in this snippets section have all a small example on how to use the functions. All sources are also included.

Contents

Input functions

Almost all applications need functions that process user input. On handheld terminals this input can be realised by keyboard input as well as by reading bar codes. Therefore this section contains several functions that can be used to process keyboard input and scanner input.

Database functions

Database files can be used to temporarily store user input, but also to hold product information, like prices and descriptions. Creating a perfectly working database with all its required functions for adding, reading, deleting, sorting and searching of records is always a very time consuming process. Therefore this section contains all sorts of functions needed to add a complete database implementation into your application.

Menu functions

A lot of application use a menu to let the user select specific options. Creating a menu structure for the first time can be a real strucle to get the layout in a good working order. These menu functions will show that adding a menu to your application can be done with only a few lines of code.

String functions

This section contains general functions, which are quite often used in applications for managing strings. The supplied functions show how to remove specific leading and trailing characters from a string and also show howto center a string for displaying purposes.

Flash functions

Since most terminals only contain a RAM-disk. There's always the risk of losing important settings (i.e. when the main and back-up battery are both empty). This section explains how settings can be stored in non-volatile flash memory to be certain that important settings are never lost.

Miscellaneous

This section contains general functions, which are quite often used in application, like the calculation of the current day of the week or the week number. In the future more functions will be added to this section.

Views
Personal tools