Description
Some Isah tables contain fields that do not contain the value as displayed on screen, but which contain a code that refers to the value. Carry out the following actions to retrieve the name of such a drop-down list box:
Properties, Procedures and Functions
Function GetTypeString( Name: String): String
Function GetTypeStringValue( Name: String, Type: String): Integer
Function GetTypeValueString( Name: String, Item: Integer): String
Example
Sub Main()
' Displays all order codes
MsgBox
Application.GetTypeString("
OrdCode
")
MsgBox
Application.GetTypeStringValue ("
OrdCode
","
Purchasing
")
MsgBox
Application.GetTypeValueString ("
OrdCode
",3)
End Sub
Example
Combination with a combo box
Sub
Main()
if
ShowEditForm = 1 then
MsgBox
"
You have confirmed the entry
"
End If
End Sub
Function
ShowEditForm()
Dim
frm, X, Y
Dim
CmbBox
' Creates an empty form
Set
frm = application.IsahForms.CreateEditForm
frm.EditOffSet = 125
frm.Caption = "
Basic data entry form
"
Set CmbBox = frm.AddComboBox ("
CB1
",,,,"
Combo box example
","",0,false)
' Fills a combo box with info from DmTypes
CmbBox.Items = Application.GetTypeString("
OrdCode
")
' 4 is the DB value or fixed value of example
CmbBox.Text= application.GetTypeValueString("
OrdCode
",4)
frm.SetBounds 0,0,266,153
frm.Center
ShowEditForm = frm.ShowModal
' Determines the value of the selected line
MsgBox
Application.GetTypeStringValue("
OrdCode
" , CmbBox.Text)
End Function
Example
Combination with a combo box
Sub
Main()
if
ShowEditForm = 1 then
MsgBox
"
You have confirmed the entry
"
End If
End Sub
Function
ShowEditForm()
Dim
frm, X, Y
Dim
CmbBox
' Creates an empty form
Set
frm = application.IsahForms.CreateEditForm
frm.EditOffSet = 125
frm.Caption = "
Basic data entry form
"
Set CmbBox = frm.AddComboBox ("
CB1
",,,,"
Combo box example
","",0,false)
CmbBox.Items = Application.GetTypeString("
OrdCode
")
CmbBox.ItemIndex = Application.GetTypeStringValue("
OrdCode
","
Phantom
")
frm.SetBounds 0,0,266,153
frm.Center
ShowEditForm = frm.ShowModal
End Function