Format and Format$

  • Thread starter Thread starter stripes
  • Start date Start date
S

stripes

Guest
Ok, this one should be so easy, but I cant figure it out!

I have a VB .NET program that Ive written which takes basketball statistics and writes a report to a .TXT file. Each line has a mixture of data (strings and integers). Here is how I am trying to print the line:

PrintLine(2, Format$(print_player_info(i, j, 1), "@@@@@@@@@@@@@@@@") & " " & Format$(print_player_info(i, j, 2), "@@@") & " " & Format(print_player_info(i, j, 3), "00") & " " & Format(print_player_info(i, j, 4), "00") & " " & Format(print_player_info(i, j, 5), "000") & " " & Format(print_player_info(i, j, 6), "000") & " " & Format(print_player_info(i, j, 7), "00") & " " & Format(print_player_info(i, j, 8), "000") & " " & Format(print_player_info(i, j, 9), "00") & " * " & Format(print_player_info(i, j, 10), "00") & " " & Format(print_player_info(i, j, 11), "0.0") & " " & Format(print_player_info(i, j, 12), "00.0") & " " & Format(print_player_info(i, j, 13), "00.0") & " " & Format(print_player_info(i, j, 14), "0.0") & " " & Format(print_player_info(i, j, 15), "00.0") & " " & Format(print_player_info(i, j, 16), "0.0"))

Here is what prints:

@@@@@@@@@@@@@@@@ @@@ 00 00 000 000 00 000 00 * 00 0.0 00.0 00.0 0.0 00.0 0.0

As I run the program, Ive checked to ensure that I have valid data in the fields being printed, but all I get the 0s and @s.

Im not a technical guru with this stuff.....HELP!!!!
 
1.) If youre going to use Fomat(), use Format$() instead, since it is
optimized for strings.

2.) Dont use Format$() in VB.NET, however. Use any strings Format
method, in this example: print_player_info.Format()

3.) For goodness sakes dont use the same file-writing methods as
in VB6; use the stream capabilities in the System.IO namespace.

4.) What do you intend to put in place of the @s? Look up the
format function in your help file:

ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemStringClassFormatTopic.htm
 
Back
Top