dbgetchar

Returns a pointer to a character in the command buffer.

Syntax

LPSTR dbgetchar (
PDBPROCESS
dbproc,
INT
n );

where

dbproc
Is the DBPROCESS structure that is the handle for a particular workstation/ SQL Server process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.
n
Is the character to find in the command buffer. The first character is the 0th character.

Returns

A pointer to the nth character in the command buffer. If n is not in range, NULL is returned.

Remarks

The dbgetchar function can be used to find a particular character in the command buffer. It returns a pointer to the nth character in the command buffer.

Internally, the command buffer is a linked list of non-null-terminated text strings. Parts of the command buffer can be located and copied using the dbgetchar, dbstrcpy, and dbstrlen functions.

Since the command buffer is not just one large text string, but rather a linked list of text strings, you must use dbgetchar to index through the buffer. If you just get a pointer using dbgetchar and then increment it yourself, it will probably fall off the end of a string.

See Also

dbcmd, dbfcmd, dbfreebuf, dbstrcpy, dbstrlen