CAPL Script

Get Next C A Ndb File 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 getNextCANdbFilename( dword pos, char buffer[], dword size);

Function

Finds out the file names of the other assigned databases withpos.

Parameters

pos Position number of the database to be found.

buffer

Buffer in which the database file 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 = GetFirstCANdbFilename(buffer, elcount(buffer));
  while (pos != 0)  {
    write("CANdb: %s", buffer);
    pos = GetNextCANdbFilename(pos, buffer, elcount(buffer));
  }
}
on key '3'  {
  char buffer[256];
  dword pos;
  // Position 2 is the predecessor of the requested third database.
  pos = GetNextCANdbFilename(2, buffer, elcount(buffer));
  if (pos != 0) write("Database %u: %s", pos, buffer);
  else write("Third database was not found");
}

Related reference: getFirstCANdbFilename | getNextCANdbName