Recent

Author Topic: Record List for Free Pascal  (Read 2088 times)

suddendeath

  • New Member
  • *
  • Posts: 13
Record List for Free Pascal
« on: February 03, 2019, 04:57:39 am »
This is a simple record list i use in my bbs software in freepascal, i saw a few posts of ppl looking for something similar online when i made it so i am releasing it , if you make any improvements to it please let me know or any bug fixs or more error correction etc..

dennis martin
aka
sudden death ( vision2 bbs software)

M.A.R.C.

  • Jr. Member
  • **
  • Posts: 70
Re: Record List for Free Pascal
« Reply #1 on: April 05, 2020, 09:12:25 am »
Thanks

Thaddy

  • Hero Member
  • *****
  • Posts: 10488
Re: Record List for Free Pascal
« Reply #2 on: April 05, 2020, 11:37:24 am »
It is a bit old school, good code, but I prefer generics for that. Or modern advanced records and the like.
So there are better options than using object. Mind you, the code is good, just a bit old fashioned.
Which is not necessarily bad.
Also the code is probably not very memory efficient.
« Last Edit: April 05, 2020, 11:40:47 am by Thaddy »
When you ask a question that is actually answered in the documentation, you are either lazy or a moron.

Handoko

  • Hero Member
  • *****
  • Posts: 3775
  • My goal: build my own game engine using Lazarus
Re: Record List for Free Pascal
« Reply #3 on: April 05, 2020, 01:55:09 pm »
@suddendeath

Thank you for sharing the code.
It is nicely written.

But may I ask, why you need to put self on:

Code: Pascal  [Select][+][-]
  1. constructor tRecordList.Init(recSize: integer);
  2. begin
  3.   SetLength(fList, 0);
  4.   Self.fRecSize := recSize;
  5. end;

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8734
  • FPC developer.
Re: Record List for Free Pascal
« Reply #4 on: April 05, 2020, 04:53:07 pm »
Probably that self was just to popup the codetools populated with the current class' properties of methods.

I do that too all the time.

BrunoK

  • Sr. Member
  • ****
  • Posts: 262
  • Retired programmer
Re: Record List for Free Pascal
« Reply #5 on: April 05, 2020, 05:11:33 pm »
Probably that self was just to popup the codetools populated with the current class' properties of methods.
Me too.

It would be nice that something like maybe shift+ctrl+F7 would pop up the evaluate/change inspector on self for in a class methods.

lucamar

  • Hero Member
  • *****
  • Posts: 3029
Re: Record List for Free Pascal
« Reply #6 on: April 05, 2020, 06:32:54 pm »
It would be nice that something like maybe shift+ctrl+F7 would pop up the evaluate/change inspector on self for in a class methods.

<Ctrl+Space> is normally enough for that, though (of course) it also pops up any global/local in scope, so sometimes one have to type some chars of the name one's looking for. At least that's what I do most of the time ;)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018