Tech Note 05: Libraries in NS Basic/Symbian OS

May 01, 2008

© NSB Corporation. All rights reserved.

NS Basic's libraries are like dynamically linked libraries on desktop systems and make functions and subroutines available to other programs. NS Basic provides a way to use many libraries within an NSBasic program. Tech Note 05a: Using Libraries describes how to use a library. In addition, there are tech notes and examples for using many specific libraries.

Libraries come from several different sources:

For more information on writing and adapting libraries, see Tech Note 05b: Writing and Adapting Libraries

A library for use with NSBasic has two components:

One is a file containing the library. The name ends in .prc. This file must be included as a resource in each NS Basic app that will use the library. These files should be kept in the Download folder within the NS Basic OS install folder (e.g. C:\NSBasic\Download).

The other is an information file, whose name ends in .inf. These files are kept in the Libs folder within the NSBasic install folder (e.g. C:\NSBasic\Lib). Information files provide information for the IDE to use when constructing calls to libraries. They are not downloaded onto the device. The process of adapting a library to run under NS Basic, when possible, only requires changing the information file. There are two versions of information files. The main difference is that version 2 provides automatic type checking. All new development should use version 2. Version 1 is deprecated, but there are still some of this version around. For more information, see Using Libraries.

List of Libraries

This is a list libraries and extensions that are known to work with NS Basic/Symbian OS. If you know of additional libraries that should be listed here, please let us know.

For further information on each library, click the documentation link.

Name Description Type Price Sample
BitsNBytesLib BitsNbyteslib adds a number of handy functions to NS Basic/Symbian OS for doing bit manipulation and conversions. You can do a variety of bitwise AND, OR and NOT operations, shift bits left and right, and convert between hex, binary and decimal. Included with NS Basic.
Included in NS Basic
--

BitnGadf.prj in Samples folder

HttpLib2 The HTTPLib2 library is an HTTP library which allows an application developer to write NSBasic programs that interact with a web service over the Internet via the HTTP protocol. This library does not need the iNetLib, unlike HTTPLib.
Shareware/ Commercial
€25/€100
--
ScreenLib It allows you to change the bit depth and color attributes. There are also drawing functions and a screen lock function. Included with NS Basic.
Included in NS Basic
--
ScreenLibTest.prj in Samples folder
StringLib NSBStringLib adds a number of handy functions to NS Basic/Symbian OS for doing string manipulation and data formatting. Included with NS Basic.
Included in NS Basic
--
StringLibUse.prj in Samples folder
SystemLib NSBSystemLib contains functions that provide access to the underlying API functions. Some of these functions allow calls to APIs that can not currently be called using NSBasic's SysTrap statements. Others, just provide a simplified interface. Included with NS Basic.
Included in NS Basic
--
SysLibTest.prj in Samples folder
TcpIpLib TcpIpLib is a simple to use library that lets you communicate from a device using Tcp/IP. There is also sample code to exchange data with a VB app on the desktop. Included with NS Basic.
Included in NS Basic
--
TCPIPDemo.prj in Samples folder
VFSLib NSBVFSLib contains functions that provide access to the external storage card(s). Included with NS Basic.
Included in NS Basic
--
VFSTest.prj in Samples folder