Get First C A Ndb Name
This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.
Syntax
dword getFirstCANdbName( char buffer[], dword size)
Function
Finds out the name of the first assigned database.
Parameters
buffer Buffer in which the database name is written.
size
Size of the buffer in Byte.
Return Values
If successful unequal 0, otherwise 0.
on start {
char buffer[256];
dword pos;
pos = GetFirstCANdbName(buffer, elcount(buffer));
while (pos != 0) {
write("CANdb: %s", buffer);
pos = GetNextCANdbName(pos, buffer, elcount(buffer));
}
}
on key '3' {
char buffer[256];
dword pos;
// Position 2 is the predecessor of the requested third database.
pos = GetNextCANdbName(2, buffer, elcount(buffer));
if (pos != 0) write("Database %u: %s", pos, buffer);
else write("Third database was not found");
}
Related reference: GetMessageName | getNextCANdbName | getFirstCANdbFilename