Click to See Complete Forum and Search --> : Format$ is returning blank strings


AlexDJ
May 18th, 2001, 03:45 PM
Hello!

I'm using format to format a number in exactly 15 characters but this is returning a blank string, does anyone have an idea why?
So far only text works eg. "ABC", not numbers.

This is just a reduced demonstration i typed right now:
_______________________________________________
Private Sub ApplyCaption()
Dim vSPC as string

vSPC = string(15," ")

lbldemo.caption = format$(str (VarInteger),vSPC)

End Sub
_________________________________________________


Thanks a lot, I'm almost finished my freeware game and this is really getting in the way!

Alex Pineda

-------------------------------------------------
Visit www.bluecatstudios.i-p.com

moebious
May 18th, 2001, 03:48 PM
Look up format in the help file i think you will find that when you set your format you need to use symbols instead of space characters
format(blah,"*****")

coolbiz
May 19th, 2001, 10:25 AM
Not sure how exactly you wanna format the number. But if you have 123 and you want the output to be 000000000000123, the code below should do it.

Format(CStr(IntVal), "000000000000000")

-Cool Bizs