Page History
...
' Declare variables.
...
Dim sBuff As String
Dim iRet As Integer
Dim lFlags As Long
' Associate fields with the session. Note that this only has to be
' done once for a particular field.
iRet = LceUseField(iSession, "DEPTMENT, DEPTDESC")
...
' Get the default value for Department Code. Note that the subroutine
' sTrim() removes leading and trailing blanks as well as any NULL
' terminator at the end of the string.
sBuff = String(FIELD_DATA_SIZE,
...
Chr(0))
...
iRet = LceGetDefaultValueX(iSession,
...
"DEPTMENT",
...
sBuff,
...
lFlags)
If lFlags = 1 Then
txtCode.Text = "Null value"
Else
txtCode.Text = sTrim(sBuff)
EndIf
' Get the default value for Department Description.
sBuff = String(FIELD_DATA_SIZE,
...
Chr(0))
...
iRet = LceGetDefaultValueX(iSession,
...
"DEPTDESC",
...
sBuff,
...
lFlags)
...
If lFlags = 1 Then
txtDesc.Text = "Null value"
Else
txtDesc.Text = sTrim(sBuff)
EndIf