Devopen function is used to send raw characters to a device. We also mention that this support is platform specific and hence not available on all the platforms. On platforms like Linux all devices including IRDA, Bluetooth and USB Serial adapters show up as standard files so you can send raw data using these functions.
Generally most printers don''t accept raw characters to print, they will either require some sort of data protocol or data to be present in Postscript format.
On Win32 most printers support Postscript only, so even if you could open the device to print you will have to generate data in Postscript format which is not practical . Apart from that you will also have to allow the user to select the printer (as there might be more than one printer) you will also have to give print preview, landscape/portrait selection etc,
Use any one of the below given options for printing on Win32 Platform:
1.If you want to print plain text, generate a
text file and print using notepad.
2.If you want to print a richly formatted text
you can generate a HTML file and print using
Internet Explorer.
3.You can use Saveimage function to create a
Jpeg of the current GoDB Screen and print
it using photoviewer or IE.
4.Call Win32 API directly from GoDB to call the
API for printing (See Calllibfunc API).
Use any one of the below given options for printing on Pockt PC device:
1.If the device shows up as serial Port, most
IRDA,Bluetooth and USB printers do.
2.you need to get the comport device name and
fopen it and fwritebin2 to it (Provided
the device driver for the printer does not
require any IOCTLS. )
3.Use Win32 API that can now be called directly
from GoDB to print (See Calllibfunc API in help
menu)
4.Use third party software like PrintBoy or the
driver from HP.
The DB_Setoption function is used to connect the external database. Providers like gADODLL.dll file is used. Then using db_exec function insert,select and update etc in the external database can be done.
Example for DB_Setoption using SQL Server 2000
DB_SETOPTION "LoadDriver=gADODLL.dll",1,A
DB__SETOPTION "Provider=sqloledb;Data Source=Test;Initial Catalog= GoDBSS;UserId=sa;Password=;",1,A
db_exec "update usrlist set siteid=1 where siteid=1",1,A
db_exec("insert into userlist values (''1'',''Test'')",1,
DB_RSFETCH A,"select * from UsrList",0
whileDB_RSISEOF(A)=0
print @A.UsrID;@A.FullName$
DB_RSMOVENEXT A
wend
DB_RSCLOSE A
DB_SETOPTION "UnLoadDriver",1,A
For more details kindly refer GoDB Help
GoDB Help -----> Contents -----> GBasic Reference -----> Database Functions -----> DB_SETOPTION.
SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. SQLite lacks built-in support for stored procedures. For more details about the SQLite kindly refer the following link http://www.sqlite.org/
When a project is compiled all these files are bundled into a single BDB file. The GoDB VM loads and executes this BDB file. . This BDB file is platform neutral so you can copy a BDB file created on one platform say Win32, copy it to an another platform say Linux your application should run without any change.
GoDB was designed primarily for business applications that communicate with GoDB Sync server to source data for local tables, download the Frm,Bas and Bin files etc.For authentication purpose user has to log into the client application and use these credentials during sync process with GoDB Sync server. Information like the UserID,Password, Sync server IP address are held in CONFIG.INI configuration file.
To set the configuration the Config.frm is used. To load the config form you can press F9 in the simulator platforms. On the device the configuration form can be loaded using the "?A" URL. OR From GBasic LoadURL("?A")
If a project compiled, all compiled files are bundled into a single BDB file. SwitchToIfRunning is 1 by default.
Pressing F11 will switch the application and F12 will close the application on top.
As for printing incase you are having issues with ComPort you can just print by writing the contents you want to print to a file using fprint and then open the file in notepad with print option.
Error Handling for various functions like Net IO etc are based on return values. For handling errors related to database, db_error$() will determine if an error has happened or not.
db_exec "insert into test values(1,''100'')",0
If len(db_error$() ) > 0 Then
''Failed
EndIf
You can use SETERRHANDLER function with GBErrNo and GBError$ functions for error handling. SETERRHANDLER command is used to set the page that will handle the errors in GBasic Applications.
We have eliminated try catch functionality due to performance related issues on low processor limited memory devices.
Yes, GoDB supports multilingual application development for PocketPC, Simputer and for all platforms. When dealing with multi lingual fonts or devices that do not have keyboards, GoDB provides an extensible Multilingual Keyboard and GBasic API for managing the Keyboard.
Following are the steps to sync
1) Create a partnership with desktop
2) select Files from the list and activesync will create C:\Documents and Settings\windows user\My Documents\View My Documents and create a shortcut on desktop with "View My Documents" name.
3) This folder is mapped to My Documents folder on the handheld device.
4) Any files/folders created in the above folders either on desktop or handheld, will autmoatically be synced by active sync.
for example
add a file called "test.txt" with some content to C:\Documents and Settings\windows user\My
Documents\View My Documents and activesync will automatically copy this file to My documents
folder on handheld device.
Vice-versa is also done the same way by active sync
when a create table statement contains "On Conflict Replace" over Unique key constraint, the statement db_error$() will not throw error message.
for eg:
consider the table
create table tbltest (Id int NOT NULL DEFAULT 900000000,name varchar(50) NOT NULL ,age int NOT NULL ,dob varchar(23) NOT NULL , Primary Key (Id) , Unique (name,age) On Conflict Replace )
when you insert the foll. stmt,
db_exec "insert into tbltest(name,age,dob) values(''v1'',''30'',19750319)",1
db_exec "insert into tbltest(name,age,dob) values(''v1'',''30'',19750319)",1
Here db_error$() will not throw any error message, this is due to On Conflict Replace statement
Xscale is version of Arm processor from Intel,
similarly Omap processor in tungsten is also a
variant of ARM processor from TI. GoDB works on all Arm variants with out any modification on supported OS. We will be porting GoDB to all emerging and popular OS/devices/processors. We can also port it to custom devices/os based on clients requirements