5

I am trying to write out to console a percentage of data loading. I tried to use C# syntax which would be Console.Write("\rPercentage: " + nCurrent + "/" + nTotal; however in VB I get the actual character 'r' being displayed in my string. Is there a special code I need to insert in order to update my cursor to the beginning of the line so that I may reuse that line?

Thanks

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Seb
  • 3,414
  • 10
  • 73
  • 106

1 Answers1

9

Use vbCr to generate a carriage return character:

        Console.Write("{0}Percentage: {1}/{2}", vbCr, nCurrent, nTotal)
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536