Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Using the Lazarus IDE
»
Editor
»
Variables in labels?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Trndi 16 is released
by
slicke
[
Today
at 03:06:44 am]
Clean up and build
by
n7800
[August 14, 2026, 11:03:28 pm]
[Qt5/Qt6] JPSupport-Qt: J...
by
Martin_fr
[August 14, 2026, 09:30:43 pm]
var vs out (including "co...
by
440bx
[August 14, 2026, 09:25:21 pm]
FpDebug: Bugs and API gap...
by
Martin_fr
[August 14, 2026, 09:19:49 pm]
Which Linux version
by
cdbc
[August 14, 2026, 08:57:51 pm]
'ReadStr' ?
by
PascalDragon
[August 14, 2026, 08:33:34 pm]
Cross platform DirectoryW...
by
LemonParty
[August 14, 2026, 07:41:15 pm]
Lazarus Bugfix Release 4....
by
wp
[August 14, 2026, 04:47:58 pm]
LRS Explorer
by
wp
[August 14, 2026, 04:02:45 pm]
TDWEdit
by
docno
[August 14, 2026, 03:35:02 pm]
BS Controls – Silly Compo...
by
Xenno
[August 14, 2026, 02:30:43 pm]
Separators in the compone...
by
JuhaManninen
[August 14, 2026, 01:28:05 pm]
Lazarus, Ubuntu Pi 4 and ...
by
Thaddy
[August 14, 2026, 12:07:04 pm]
Unleashed Pascal (async/a...
by
creaothceann
[August 14, 2026, 11:11:47 am]
AsyncProcess not firing O...
by
Martin_fr
[August 14, 2026, 11:05:52 am]
Is it possible to communi...
by
Xor-el
[August 14, 2026, 10:28:59 am]
How to avoid duplicates i...
by
mig-31
[August 13, 2026, 05:35:46 pm]
QGradientTrackPanel: A Fu...
by
Ed78z
[August 13, 2026, 04:49:24 pm]
Memory location
by
Thaddy
[August 13, 2026, 04:01:56 pm]
TurboBird IBX
by
laguna
[August 13, 2026, 03:55:51 pm]
TlsLib4Pascal
by
Xor-el
[August 13, 2026, 03:06:13 pm]
MR - DebuggerIntf for ter...
by
Martin_fr
[August 13, 2026, 12:54:22 pm]
AArch64, load a constant ...
by
LemonParty
[August 13, 2026, 12:31:06 pm]
Lazarus undead repository...
by
Dankan1890
[August 13, 2026, 10:28:54 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Variables in labels? (Read 14174 times)
T-bear
Full Member
Posts: 160
Variables in labels?
«
on:
October 10, 2010, 12:53:23 pm »
Hello
I have a little questions about labels:
Is it possible to show the value of a variable in a label, and if, how?
Thanks!
Logged
typo
Hero Member
Posts: 3051
Re: Variables in labels?
«
Reply #1 on:
October 10, 2010, 01:00:20 pm »
Well, why not? Simply set the appropriate data type to the Caption property.
Logged
LazarusBrasil.Org
T-bear
Full Member
Posts: 160
Re: Variables in labels?
«
Reply #2 on:
October 10, 2010, 01:13:53 pm »
And how do i do that?
Logged
typo
Hero Member
Posts: 3051
Re: Variables in labels?
«
Reply #3 on:
October 10, 2010, 01:19:04 pm »
If the variable is of string type, simply set:
Code:
[Select]
Label.Caption := variable;
If it is of integer type, set:
Code:
[Select]
Label.Caption := IntToStr(variable);
Logged
LazarusBrasil.Org
T-bear
Full Member
Posts: 160
Re: Variables in labels?
«
Reply #4 on:
October 10, 2010, 01:21:09 pm »
Thank you.
Logged
mas steindorff
Hero Member
Posts: 606
Re: Variables in labels?
«
Reply #5 on:
October 11, 2010, 06:00:22 pm »
FYI
almost all the components have a .tag property that you can use for your self. the int can be set to the value when you set it's label then you can access it faster later on.
read lables value
x:= strtoint(lable1.caption)
or
x := lable1.Tag
set labes value or the code above will not work
label1.caption := inttostr(x); // set text
lable1.tag := x; // and save as int
Logged
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Using the Lazarus IDE
»
Editor
»
Variables in labels?
TinyPortal
© 2005-2018