User Guide
58 Chapter 4: The Design Notes API
BOOL GetNote()
Description
This function gets the value of the specified key in the specified Design Notes file.
Arguments
FileHandle noteHandle
, const char keyName[64], char* valueBuf, int valueBufLength
• The noteHandle argument is the file handle that the OpenNotesFile() function returns.
• The keyName[64] argument is a string that contains the name of the key.
• The valueBuf argument is the buffer where the value is stored.
• The valueBufLength argument is the integer that GetNoteLength(noteHandle, keyName)
returns, which indicates the maximum length of the value buffer.
Returns
A Boolean value: true indicates the operation is successful; false otherwise. The valueBuf
argument receives the value of the key.
Example
The following code gets the value of the comments key in the Design Notes file that is associated
with the welcome.html file:
FileHandle noteHandle = OpenNotesFile("file:///c|/sites/avocado8/¬
iwjs/welcome.html");
if(noteHandle > 0){
int valueLength = GetNoteLength( noteHandle, "comments");
char* valueBuffer = new char[valueLength + 1];
GetNote(noteHandle, "comments", valueBuffer, valueLength + 1);
printf("Comments: %s",valueBuffer);
CloseNotesFile(noteHandle);
}
int GetNoteLength()
Description
This function gets the length of the value that is associated with the specified key.
Arguments
FileHandle noteHandle, const char keyName[64]
• The noteHandle argument is the file handle that the OpenNotesFile() function returns.
• The keyName[64] argument is a string that contains the name of the key.
Returns
An integer that represents the length of the value.
Example
See “BOOL GetNote()” on page 58.
000_DW_API_Print.book Page 58 Wednesday, August 20, 2003 9:14 AM