The TagBrowseFirst function places the data browse cursor at the first record.
This function is a blocking function. It blocks the calling Cicode task until the operation is complete.
Syntax
INT TagBrowseFirst(LONG Session)
Session:
The handle to a browse session previously returned by a TagBrowseOpen call.
Return Value
0 if successful -1 if unsuccessful.
Related Functions
TagInfoEx, TagInfo, TagBrowseClose, TagBrowsePrev, TagBrowseNumRecords, TagBrowseOpen, TagBrowseNext,TegBrowseGetField
Example
// first count = 1; TBResult = TagBrowseFirst(TBHandle); ErrLog("First: " + IntToStr(TBResult) + ", Error = " + IntToStr(IsError())); WHILE (TBResult <> -1) DO ErrLog("Entry " + IntToStr(count) + ": " + "Tag: " + TagBrowseGetField(TBHandle , "TAG") + ", " + "Type: " + TagBrowseGetField(TBHandle , "TYPE") + ", " + "Addr: " + TagBrowseGetField(TBHandle , "ADDR") + ", " + "Error = " + IntToStr(IsError())); TBResult = TagBrowseNext(TBHandle); ErrLog("Next: " + IntToStr(TBResult) + ", Error = " + IntToStr(IsError())); count = count + 1; END
See Also
Published June 2018