Recent

Author Topic: [SOLVED] Declaring variables and seeding a value...  (Read 3465 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
[SOLVED] Declaring variables and seeding a value...
« on: July 18, 2011, 10:13:39 am »
In Lazarus Free-Pascal, can a variable be seeded with a value at declaration time?  Mainly like for global use.

Thanks!
« Last Edit: July 19, 2011, 12:48:21 am by Elmug »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Declaring variables and seeding a value...
« Reply #1 on: July 18, 2011, 11:11:36 am »
Yes:

Code: [Select]
var
  MyBool: Boolean = True;

Any constant value can be assigned here, the most common ones being 0, nil, True, False, constant strings and various numbers.

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Declaring variables and seeding a value...
« Reply #2 on: July 18, 2011, 12:47:27 pm »
Yes:

Code: [Select]
var
  MyBool: Boolean = True;

Any constant value can be assigned here, the most common ones being 0, nil, True, False, constant strings and various numbers.

Happy to hear this, Felipe!

You know, I tried: MyBool: Boolean := True with NO LUCK...

But I will try it with just the = sign.

Thanks!!

 

TinyPortal © 2005-2018