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
exception external SIGSEG...
by
dseligo
[
Today
at 07:57:12 am]
Single / Double / Float s...
by
Khrys
[
Today
at 07:12:43 am]
Has anyone installed TeeB...
by
egsuh
[
Today
at 06:34:29 am]
Commerce website written ...
by
Handoko
[
Today
at 05:24:32 am]
Hashing pointers by using...
by
440bx
[
Today
at 01:15:38 am]
FPC 3.2.4-rc1 available
by
dsiders
[
Today
at 12:59:46 am]
Introducing PasBuild 1.0....
by
dbannon
[December 11, 2025, 11:54:37 pm]
[SOLVED] Program compiles...
by
Schmitty2005
[December 11, 2025, 07:35:39 pm]
TIBDataSet "Closing"? on ...
by
RedOctober
[December 11, 2025, 05:00:04 pm]
So many "newbies"
by
gidesa
[December 11, 2025, 04:18:38 pm]
How can I make a safe app...
by
LeP
[December 11, 2025, 03:30:34 pm]
Lazreport. Multiple print...
by
paweld
[December 11, 2025, 03:12:47 pm]
[SOLVED] Need help conver...
by
srvaldez
[December 11, 2025, 01:52:33 pm]
SpkToolbar custom update
by
wp
[December 11, 2025, 01:48:16 pm]
OS/2 Warp 4 problem with ...
by
Thaddy
[December 11, 2025, 01:35:10 pm]
Is FPGUI still active?
by
BSaidus
[December 11, 2025, 01:25:31 pm]
Bitmap into Paintbox
by
BubikolRamios
[December 11, 2025, 12:58:20 pm]
Notetask 1.1.0 - Free cro...
by
AlexanderT
[December 11, 2025, 12:11:14 pm]
Matching video to form
by
Pe3s
[December 11, 2025, 10:56:47 am]
Is Lazarus' Tool Palette ...
by
Ed78z
[December 11, 2025, 10:37:03 am]
[SOLVED] RXSwitch
by
Petrus Vorster
[December 11, 2025, 10:35:00 am]
fpsockets error: 10047
by
rvk
[December 11, 2025, 09:50:08 am]
Military Grade Directives
by
Thaddy
[December 11, 2025, 08:56:12 am]
Permutation of rows and c...
by
Zvoni
[December 11, 2025, 08:33:20 am]
Jacks or Better card game...
by
TBMan
[December 11, 2025, 03:12:03 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Variables in labels? (Read 14044 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: 560
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