sx_WorkArea

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_WorkArea

VB Declaration

Declare Function sx_WorkArea Lib "Apollo9.dll"

(ByVal cpAlias As Any)

As Integer

C Declaration

USHORT FAR PASCAL sx_WorkArea

(BYTEP cpAlias);

Description

Retrieves the table numeric work area identifier associated with a given alias name. This function is the inverse of sx_Alias, which retrieves the alias name assigned to a given work area.

 

Parameters

 

cpAlias: A variable or literal string containing the alias name assigned to the database when the file was opened. If passed as a NULL string the current work area integer is returned.

Return Value

The number assigned to the work area when the file was opened. If there is no active work area, zero (0) is returned.

VB Example

' Display database info

Text1.Text = sx_WorkArea(0&)

Text2.Text = sx_BaseName()

C Example

BYTE caString[256];

 

sx_Select(sx_WorkArea("master"));

sx_GoTop();

while (!sx_Eof())

{

sx_GetRecord((BYTEP) caString);

// if rec not deleted, copy it

if (caString[0] != '*')

{

sx_Select(sx_WorkArea("copy"));

sx_AppendBlank();

sx_PutRecord((BYTEP) caString);

}

sx_Select(sx_WorkArea("master"));

sx_Skip(1L);

}

See Also

sx_Alias