Sorry, I looked at the wrong part of the only piece of code I've written to do this. And it's kinda kludgy looking but seems to work.
void Grid::GetFileName()
{
SetCurrent();
dbInk (Red, White); // write in red
dbText (610, 160, "File: "); // lay down a prompt
CopyTo(0);
dbSync(); // and write it to the screen
dbInk (Red, White);
dbSetCursor (660, 160); // put the cursor right after the prompt
strcpy (fileName, dbInput()); // copy the return from the input to our buffer
SetCurrent(); // Now make the name a permanent part of the bitmap
dbInk (Black, White); // at the bottom of the screen
Box (point (610, 580), point(798, 599)); // make a black box
dbInk (White, White);
Box (point (612, 582), point (796, 597)); // with a smaller white text area inside
dbInk (Black, White); // write the text in black
dbText (614, 584, fileName); // and output it
}
If you ignore the screen writes and the prompt setting the core of the input is the strcpy (filename, dbInput()) statement that essentially calls dbInput() which gets your input while echoing to the display. The character pointer to the input is passed to the strcpy() function which copies the text just input into the filename buffer which is then used to output the name of the file elsewhere. The rest of it is pretty much blanking out the text left over by the input process.
However, based on a previous discussion it seems that when you do dbInput () it uses dynamically allocated memory and you need to delete[] the allocation once you're finished with it.
Lilith, Night Butterfly
I'm not a programmer but I play one in the office