Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Format$
#1
I swear, I'd posted this on the forums before, but I can't find it anymore on here.  (Maybe it's on the old forums from way back when?)

Anywho, with Rho and Eric both posting their functions to format text in a similar manner to Print Using, I thought I'd share this once again:

Code: (Select All)
Print Format(12345, "###,###")
Print Format(12345, "$###,###")
Print Format(Timer, "###,###.#####")


Function Format$ (num, using$)
    Static tempimage
    If tempimage = 0 Then tempimage = _NewImage(80, 1, 0)
    d = _Dest: s = _Source
    _Dest tempimage: _Source tempimage
    Cls
    Print Using using$; num;
    For i = 1 To 80
        p = Screen(1, i)
        If p = 0 Then Exit For
        text$ = text$ + Chr$(p)
    Next
    _Dest d: _Source s
    Format$ = text$
End Function
Reply


Messages In This Thread
Format$ - by SMcNeill - 03-30-2024, 04:52 AM
RE: Format$ - by grymmjack - 03-31-2024, 05:10 PM
RE: Format$ - by SMcNeill - 03-31-2024, 05:26 PM
RE: Format$ - by bplus - 03-31-2024, 05:26 PM
RE: Format$ - by SMcNeill - 03-31-2024, 05:30 PM



Users browsing this thread: 1 Guest(s)