sx_PutRecord

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_PutRecord

VB Declaration

Declare Sub sx_PutRecord Lib "Apollo9.dll"

(cpRecord As Any)

C Declaration

VOID FAR PASCAL sx_PutRecord

(BYTEP cpRecord);

Description

Replace an entire record with the contents of a defined record structure or formatted string.

Parameters

cpRecord: A pointer to a defined record structure (typedef) or formatted fixed string that contains the complete record contents including the hidden deletion flag field.

VB Example

' record definition in .bas file

' log record to test sx_GetRecord/sx_PutRecord

Type LogRec

lDelFlag As String * 1 ' Note delete flag in rec definition

lCust As String * 6

lName As String * 40

lPhone As String * 20

lFax As String * 20

lLineNum As String * 2

lToWho As String * 3

lTakenBy As String * 3

lCallNum As String * 5

lCallType As String * 1

lCallTime As String * 4

lTimeOn As String * 4

lTimeOff As String * 4

lDate As String * 8

lElapsed As String * 4

lStatus As String * 1

lProduct As String * 7

End Type

 

Sub ButtonWrite_Click ()

Dim lRec As LogRec

Dim iRet As Integer

 

If sx_Rlock(sx_RecNo()) Then

lRec.lCust = (BoxCust.Text)

lRec.lName = (BoxName.Text)

lRec.lPhone = (BoxPhone.Text)

Call sx_PutRecord(lRec)

sx_Commit

sx_Unlock sx_RecNo()

End If

End Sub

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_GetRecord