Recent

Author Topic: Basic Function help  (Read 1789 times)

Isshen

  • Newbie
  • Posts: 2
Basic Function help
« on: October 15, 2018, 04:36:38 pm »
How can i use a value that was a calculated in a function in another procedure and do calculations with it?

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Basic Function help
« Reply #1 on: October 15, 2018, 04:57:59 pm »
Hello Isshen,

welcome to the forum!

Please provide a sample.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: Basic Function help
« Reply #2 on: October 15, 2018, 05:29:43 pm »
You can store result of that function in local variable.
Code: Pascal  [Select][+][-]
  1. function MyFunc: Integer;
  2. begin
  3.   ...
  4.   Result:=...;
  5. end;
  6.  
  7. procedure MyProc;
  8. var i: Integer;
  9. begin
  10.   i:=MyFunc;
  11.   ...
  12. end;
  13.  
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

 

TinyPortal © 2005-2018