Need Help with Export Routine

rburna904

Registered User.
Local time
Today, 06:20
Joined
Jul 10, 2006
Messages
17
Ok I am exporting some data to a plain text file and one of the fields I am outputing can vary in the number of characters and I need they to have the same number of characters all the time.

Ex: 123.00 => 000012300
456789.00 => 045678900

I had heard of a command, but I can't remember what it was...I could do a loop till LEN() = 9 but that would cause undue clock cycles (aka performance hit) on the machine when running through the export routine.

This is a huge export of data.....

Thanks,
Richard
 
Format doesn't add the 0 to the begining

gemma-the-husky said:
try format(number,"0000000000")

The format routine will not add characters to if the length is not the same, I am using the following:
Code:
Do
  If Len(tmpAPPOH_TOTAL) < 9 Then
    tmpAPPOH_TOTAL = "0" & tmpAPPOH_TOTAL
  End If
Loop Until Len(tmpAPPOH_TOTAL) = 9

The command is something like LSet but I know that isn't it......
 
i've just done this

Sub testit()
Call MsgBox(Format(1, "000000"))
End Sub

and got 000001 as the answer
 
I see why it wasn't working in the first place, see with the data feed I am sending it requires an alpha character for the last place to determin + or - and corresponds to a number

Ex: -123.09 => 1230R

So the format will not work on the 1230R but will work on the 12309
 

Users who are viewing this thread

Back
Top Bottom