- Joined
- Jan 21, 2008
- Messages
- 2
- Reaction score
- 0
Im creating a macro but my problem here is that i cant add series of number after the reference. can you pls help me
e.g.
from ROD12345678 should be ROD12345678-01
With Session
REFERENCE = .GetDisplayText(4, 39, 3) & .GetDisplayText(4, 45, 6)
Do While Not Len(Trim(.GetDisplayText(10, 79, 1))) = 0
For i = 10 To 20
If Len(Trim(.GetDisplayText(i, 79, 1))) = 0 Then
GoTo CDONE
Else
If .GetDisplayText(i, 79, 1) = "E" Then
RELATION = LTrim(.GetDisplayText(i, 21, 10))
AMOUNT = .GetDisplayText(i, 64, 13)
REFF = REFERENCE & RELATION & AMOUNT
Write #3, REFF
Else
GoTo CREFRESH
End If
End If
CREFRESH:
Next i
Loop
CDONE:
.TransmitTerminalKey rcIBMF3Key
.WaitForEvent rcEnterPos, "30", "0", 3, 17
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcEnterPos, "30", "0", 3, 17
.TransmitTerminalKey rcIBMF3Key
.WaitForEvent rcEnterPos, "30", "0", 21, 7
Close #3
End With
End Sub
e.g.
from ROD12345678 should be ROD12345678-01
With Session
REFERENCE = .GetDisplayText(4, 39, 3) & .GetDisplayText(4, 45, 6)
Do While Not Len(Trim(.GetDisplayText(10, 79, 1))) = 0
For i = 10 To 20
If Len(Trim(.GetDisplayText(i, 79, 1))) = 0 Then
GoTo CDONE
Else
If .GetDisplayText(i, 79, 1) = "E" Then
RELATION = LTrim(.GetDisplayText(i, 21, 10))
AMOUNT = .GetDisplayText(i, 64, 13)
REFF = REFERENCE & RELATION & AMOUNT
Write #3, REFF
Else
GoTo CREFRESH
End If
End If
CREFRESH:
Next i
Loop
CDONE:
.TransmitTerminalKey rcIBMF3Key
.WaitForEvent rcEnterPos, "30", "0", 3, 17
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcEnterPos, "30", "0", 3, 17
.TransmitTerminalKey rcIBMF3Key
.WaitForEvent rcEnterPos, "30", "0", 21, 7
Close #3
End With
End Sub