Lazarus
Home
Forum
Help
TinyPortal
Search
Login
Register
Lazarus
»
Free Pascal
»
Beginners
(Moderators:
FPK
,
Tomas Hajny
) »
Calling from procedure
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
FAQ
Wiki
Bugtracker
Packages
IRC channel
Developer Blog
Follow us on Twitter
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
Search
Advanced search
« previous
next »
Print
Pages: [
1
]
Author
Topic: Calling from procedure (Read 1164 times)
Cranky
Newbie
Posts: 4
Calling from procedure
«
on:
April 29, 2017, 12:54:06 am »
Hello, please I need help.
Code: Pascal
[Select]
unit
Unit1
;
{$mode objfpc}{$H+}
interface
uses
Classes
,
SysUtils
,
FileUtil
,
Forms
,
Controls
,
Graphics
,
Dialogs
,
ExtCtrls
,
StdCtrls
;
type
{ TForm1 }
TForm1
=
class
(
TForm
)
Label1
:
TLabel
;
Timer1
:
TTimer
;
etc
...
I need to access Timer1 from my procedure
Code: Pascal
[Select]
procedure
simMain
;
begin
TTimer
.
Enabled
:
=
true
;
end
;
but I am getting error: unit1.pas(70,4) Error: Identifier not found "Timer1"
Thanks for all replies
Logged
josh
Hero Member
Posts: 520
Re: Calling from procedure
«
Reply #1 on:
April 29, 2017, 01:33:15 am »
Hi
You have named your 'TTimer' Timer1 and it is part of the Form1
To access the timer call it by it's name ie
Timer1.enabled:=false;
Your procedure does not look to be part of the form , so to call it in this procedure you will also have to tell it where the timer1 is ie
procedure dosomething;
begin
Form1.Timer1.enabled:=false;
end;
Logged
Development Installation Lazarus 1.3, FPC 2.7.1,Windows 7/8 32/64, OSX, *nix
Test Environment Lazarus & FPC Trunk on Windows and OSX (Cocoa Mainly on OSX). Testing also Crosscompile windows to OSX..
Any posts made from 2015 will be based on Lazarus Trunk.
Cranky
Newbie
Posts: 4
Re: Calling from procedure
«
Reply #2 on:
April 29, 2017, 08:28:55 am »
Great it works, thank you
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Free Pascal
»
Beginners
(Moderators:
FPK
,
Tomas Hajny
) »
Calling from procedure
Recent
Material Design
by
lainz
[
Today
at 03:12:09 pm]
Insert check mark symbol
by
exdatis
[
Today
at 03:08:44 pm]
how to disable directive
by
taazz
[
Today
at 02:56:07 pm]
Fpcupdeluxe
by
EMartin
[
Today
at 02:53:07 pm]
An advice - um conselho
by
hrayon
[
Today
at 02:43:40 pm]
macOS 32-bit app warning
by
Phil
[
Today
at 02:40:10 pm]
IDE output window shown, ...
by
Lyvia
[
Today
at 02:26:23 pm]
lazSubTitlesTranslator fo...
by
laguna
[
Today
at 12:41:07 pm]
Compiler can't find TPU f...
by
Thaddy
[
Today
at 12:26:46 pm]
[TCocoaMenuItem _setMenuO...
by
Renat.Su
[
Today
at 12:20:03 pm]