Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
using later defined procedures
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
FPC Unleashed (inline var...
by
Fibonacci
[
Today
at 07:15:58 pm]
fp-h2pas: New C header tr...
by
Gustavo 'Gus' Carreno
[
Today
at 06:32:22 pm]
Nezplug Library Player
by
Gigatron
[
Today
at 04:15:33 pm]
Eschecs (UCI chess GUI) 5...
by
Roland57
[
Today
at 04:10:12 pm]
[ANN] fpGUI Toolkit v2.0....
by
cdbc
[
Today
at 03:14:21 pm]
AI assisted translation o...
by
schuler
[
Today
at 02:25:26 pm]
I hope FreePascal can sup...
by
Zvoni
[
Today
at 01:58:08 pm]
Lazarus Bugfix Release 4....
by
dbannon
[
Today
at 01:52:18 pm]
Strange happenings with T...
by
jamie
[
Today
at 12:41:42 pm]
Little bit...
by
jamie
[
Today
at 12:17:43 pm]
Necromancer's Dos Navigat...
by
dbannon
[
Today
at 11:03:26 am]
Can't pass string to TEdi...
by
cdbc
[
Today
at 10:13:44 am]
How to merge multiple cla...
by
cdbc
[
Today
at 09:52:55 am]
Remote desktop software i...
by
Ericktux
[
Today
at 08:50:58 am]
Fixed Bzip2 unpacker from...
by
domasz
[
Today
at 08:09:54 am]
Ann: DeCoperators
by
Thaddy
[
Today
at 07:37:29 am]
Weird error
by
xiyi0616
[
Today
at 03:47:04 am]
Bad Sandwich
by
Guva
[April 12, 2026, 09:55:25 pm]
ZeosDB and sqlite3
by
dseligo
[April 12, 2026, 09:06:22 pm]
The ever re-appearing /= ...
by
Thaddy
[April 12, 2026, 08:07:09 pm]
Some Lazarus Graphics Rel...
by
Boleeman
[April 12, 2026, 03:45:30 pm]
Some Lazarus Utils N Stuf...
by
Boleeman
[April 12, 2026, 03:39:45 pm]
Ann: Deinline: a de-inlin...
by
Fred vS
[April 12, 2026, 03:17:40 pm]
BAScript - Simple scripti...
by
Ñuño_Martínez
[April 12, 2026, 01:00:21 pm]
NiceGrid component for La...
by
Alexandr R
[April 12, 2026, 11:02:54 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: using later defined procedures (Read 1860 times)
nugax
Full Member
Posts: 232
using later defined procedures
«
on:
February 23, 2018, 06:49:35 pm »
This is remedial, i know... but its driving me nuts.
If i have a procedure that calls a procedure that is defined later, how can I use it? Is there a way to declare it so it can be used now in a procedure, yet defined later?
Logged
-Nugax
rvk
Hero Member
Posts: 6989
Re: using later defined procedures
«
Reply #1 on:
February 23, 2018, 06:55:56 pm »
Like this:
http://wiki.freepascal.org/Forward_Referencing
Code: Pascal
[Select]
[+]
[-]
procedure
Later
(
parameter list
)
;
forward
;
procedure
Sooner
(
parameter list
)
;
begin
...
Later
(
parameter list
)
;
end
;
...
procedure
Later
;
begin
...
Sooner
(
parameter list
)
;
end
;
Logged
Eugene Loza
Hero Member
Posts: 729
Re: using later defined procedures
«
Reply #2 on:
February 23, 2018, 08:15:37 pm »
or like this
Code: Pascal
[Select]
[+]
[-]
Unit
SomeUnit
;
interface
procedure
Later
;
//makes it also available for other units, mark no "forward" here.
implementation
procedure
Sooner
;
begin
Later
;
end
;
procedure
Later
;
begin
DoSomething
;
end
;
Logged
My FOSS games in FreePascal&CastleGameEngine:
https://decoherence.itch.io/
(Sources:
https://gitlab.com/EugeneLoza
)
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
using later defined procedures
TinyPortal
© 2005-2018