Recent

Author Topic: Display Mask  (Read 1566 times)

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Display Mask
« on: March 28, 2018, 11:20:36 pm »
I'm using a TLabel.

I want to display a string of 1.. 4 digits in the TLabel left aligned,

Is there a mask  that will provide this feature for a TLabel?.

Example:   |     1|
                |    23|
                |  987|
                |9999|
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

jamie

  • Hero Member
  • *****
  • Posts: 6128
Re: Display Mask
« Reply #1 on: March 28, 2018, 11:26:08 pm »
Yup there is...

 You do need to build a string to display in it...

 Use "Str", it works like the WrteLN/write calls do using the format indicators.

 Str(mynumber:10:0, returnString);

 that is a total of 10 digits, spaces are inserted as needed

 of course you could use FORMAT

The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018