This seems so trivial…
In both the following examples the flatfiles input have fields with leading zeroes. ( none to 2 zeroes eg. “0012345” ).
The idea is to get them to a text filed without the zeroes
(“12345”)
Example 1 …fails as noted ******
Dim mgrtempnbr As Double
Dim MgrEN As String
.
.
MgrEN = Trim$(Mid$(XLine,72,7)) ’ load with manager
mgrtempnbr = Cdbl(MgrEN) '****TYPE MISMATCH
MgrEN = Str$(mgrtempnbr)
I have tried this with or without the functions.
Example 2 seems to work…
Dim SaveKey As String
Dim SaveKeyNbr As Double
.
.
SaveKey = Trim$(Mid$(CurLine,1,11)) ’ Employee Number
.
.
’ Drop leading zeroes.
SaveKeyNbr = SaveKey
SaveKey = SaveKeyNbr