Recent

Author Topic: TDictionary syntax  (Read 4480 times)

mrspock1

  • New Member
  • *
  • Posts: 29
TDictionary syntax
« on: September 26, 2018, 11:16:32 am »
on line

TgrafDFS = TDictionary<TskompresowanyWierzcholek, Tzaslepka>;

compiler gives an error
";" expected but "<" found

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: TDictionary syntax
« Reply #1 on: September 26, 2018, 11:18:20 am »
Please show a small compilable problem that we can test and compiler version  (do you  have 3.2 or 3.3.1 and include generics.collections?)

I use tdictionary daily and it generally works fine, so it must be in the details.

mrspock1

  • New Member
  • *
  • Posts: 29
Re: TDictionary syntax
« Reply #2 on: September 26, 2018, 11:27:18 am »
Lazarus 1.8.4 FPC 3.0.4 do not know anything else
uses generics.collections

Am I supposed to upload the "pas" file somewhere?

hnb

  • Sr. Member
  • ****
  • Posts: 270
Re: TDictionary syntax
« Reply #3 on: September 26, 2018, 11:34:12 am »
probably you need to use Delphi mode. If you don't have genercs.collections module you have 3 options:

1. download library from https://github.com/maciej-izak/generics.collections
2. add Lazarus package sparta_generics to the project
3. you can use FPC trunk (for example via fpcupdelux)
Checkout NewPascal initiative and donate beer - ready to use tuned FPC compiler + Lazarus for mORMot project

best regards,
Maciej Izak

mrspock1

  • New Member
  • *
  • Posts: 29
Re: TDictionary syntax
« Reply #4 on: September 26, 2018, 11:51:28 am »
I have no idea how to to do any of those.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: TDictionary syntax
« Reply #5 on: September 26, 2018, 11:53:52 am »
Or try the 3.2.0-beta lazarus installer snapshot mentioned here:

http://forum.lazarus.freepascal.org/index.php/topic,42265.msg294787.html#msg294787

 

TinyPortal © 2005-2018