sx_Select

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_Select

VB Declaration

Declare Function sx_Select Lib "Apollo9.dll"

(ByVal uiBaseArea As Integer)

As Integer

Description

Selects an existing work area and make it the current work area.

Parameters

uiBaseArea: The work area number returned when the file was opened.

Return Value

The previous select area is returned. If there was no previous area active, zero is returned.

VB Example

' Toggle between two different work areas

Sub ButtonSelect_Click ()

If sx_WorkArea(0&) = LogArea Then

sx_SetFilter 0&

Label1.Caption = "Product Area="

ButtonSelect.Caption = "Log"

iRet = sx_Select(ProdArea)

sx_GoTop

BoxSelect.Text = Format$(ProdArea, "00")

BoxCount.Text = Format$(sx_RecCount(), "#####0")

BoxCust.Text = sx_GetString("part_num")

BoxName.Text = sx_GetString("product")

BoxRecno.Text = Format$(sx_RecNo(), "###0")

' current work area is not log file

Else

Label1.Caption = "sxlog Area="

ButtonSelect.Caption = "Product"

iRet = sx_Select(LogArea)

sx_GoTop

BoxSelect.Text = Format$(LogArea, "00")

BoxCount.Text = Format$(sx_RecCount(), "#####0")

Call sx_GetRecord(lRec)

BoxCust.Text = lRec.lCust

BoxName.Text = lRec.lName

BoxRecno.Text = Format$(sx_RecNo(), "###0")

End If

' display file statistics

BoxCA.Text = sx_WorkArea(0&)

BoxFN.Text = sx_BaseName()

BoxAN.Text = sx_Alias(0)

BoxLU.Text = sx_BaseDate()

BoxRS.Text = sx_RecSize()

End Sub

See Also

sx_WorkArea