Function : Item (Field)

NSFItemScan - Calls action routine for each item found in a note.
----------------------------------------------------------------------------------------------------------

#include <nsfnote.h>

STATUS NSFItemScan(
NOTEHANDLE note_handle,
NSFITEMSCANPROC ActionRoutine,
void far *func_param
);

Description :

This function finds all the fields in a note. As it does so, NSFItemScan calls a user-supplied action routine for each field (item) in the note. The action routine can read the contents of the field, then returns control to NSFItemScan so the next field can be found.

This function, and your action routine, enables your program to open a note and determine which items (if any) are present. Then for each field, your program can find the field's data type, item flags, name, and contents -- all without knowing the form that was used to create the note.

The action routine can read the contents and properties of each field, but may not modify a field. This is because the action routine is passed the actual memory pointers of the field contents, and these should not be modified. If you want to modify a field, do so with the NSFItemSet* functions or with NSFItemDelete/NSFItemAppend. Modify fields only after NSFItemScan has completed -- not while it is still finding fields.


Parameters :

Sample Usage :


/* Scan all the fields in the note, calling an action routine for each. */

if (error = NSFItemScan (
note_handle, /* note handle */
field_action, /* action routine for fields */
&note_handle)) /* argument to action routine */
{
NSFNoteClose (note_handle);
return (ERR(error));
}

.
.
.


/*
This is the action routine that is called by NSFItemScan for each field in
the note.
*/

STATUS LNCALLOBACK field_action
(WORD unused,
WORD item_flags,
char far *name_ptr,
WORD name_len,
void far *item_value,
DWORD item_value_len,
void far *note_handle)
{
}



See Also :

NSFItemAppend
----------------------------------------------------------------------------------------------------------