What is wrong with this line?

Results 1 to 3 of 3

Thread: What is wrong with this line?

  1. #1
    cheri Guest

    Default What is wrong with this line?

    mstring = Format(msum, "@@@") & Space(8)<BR>I simply want to assign 3 bytes to msum, errors out each time.

  2. #2
    Mark Wilson Guest

    Default RE: What is wrong with this line?

    I assume you mean adding lead zeros to a number?<BR><BR>According to MSDN there is no Format function in VBScript (and I also get an error if I try to use it), so I wrote a short function to cover this situation.<BR><BR>Function fnLeadZeros( intNum, intPlaces)<BR> fnLeadZeros = Right(String(intPlaces, "0") & intNum, intPlaces)<BR>End Function<BR><BR>So, fnLeadZeros(28,3) returns "028".<BR><BR>Hope this helps.

  3. #3
    Cheri Guest

    Default RE: What is wrong with this line?

    Thank you for the suggestion, I&#039ll give it a try. I did find formatnumber but if i remember correctly it only formats decimals.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •