Visual Basic Form SET_236X.frm

LANSA

Visual Basic Form SET_236X.frm




Private Sub Form_Load()
'Read the passed data

'1 Open file
sParmsFile = "S_236FX_I.csv"
iParmsFile = FreeFile
Open sParmsFile For Input As #iParmsFile

'2 Read File until Parameter found or EOF
Do

Input #iParmsFile, sPName, sPType, sPValue

If sPName = "EMPNO" Then S_Empno.Text = sPValue
If sPName = "GIVENAME" Then S_Givename.Text = sPValue
If sPName = "SURNAME" Then S_Surname.Text = sPValue
If sPName = "SALARY" Then S_Salary.Text = sPValue
If sPName = "STD_TEXT" Then S_STD_TEXT.Text = sPValue


Loop Until EOF(iParmsFile)

'3 Close the file

Close #i_ParmsFile



End Sub

Private Sub pbReturnToVL_Click()

'Write exchange data to a csv file

'1 Open the file
' Get Input Parameters file with input suffix
m_ParmsFile = "S_236FX_O.csv"

'Get unused file number
m_FileNumber = FreeFile

'Create/Open Output Parameters file
Open m_ParmsFile For Output As #m_FileNumber

'2 Write the passed data to the file

Write #m_FileNumber, "EMPNO", "A", S_Empno.Text
Write #m_FileNumber, "GIVENAME", "A", S_Givename.Text
Write #m_FileNumber, "SURNAME", "A", S_Surname.Text
Write #m_FileNumber, "SALARY", "N", S_Salary.Text
Write #m_FileNumber, "STD_TEXT", "A", S_STD_TEXT.Text

'3 Close the file

Close #m_FileNumber

'Close vb program
Unload Me

End Sub

Private Sub pbClose_Click()
'Close vb program
Unload Me
End Sub