Recent

Author Topic: Where is the documentation for TVector?  (Read 6891 times)

ricardo_sdl

  • New Member
  • *
  • Posts: 21
Where is the documentation for TVector?
« on: July 05, 2018, 04:53:10 pm »
Hello!
Where can I find the documentation for the class TVector (defined inside the unit gvector)? I couldn't find any, at least nothing like there is for TBits(https://www.freepascal.org/docs-html/rtl/classes/tbits.html) for example. I noticed that TVector is part of the generic library, is it a good idea to use it? Is it experimental? Deprecated, maybe?
Thanks!

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Where is the documentation for TVector?
« Reply #1 on: July 06, 2018, 01:05:53 pm »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Where is the documentation for TVector?
« Reply #2 on: July 06, 2018, 01:17:41 pm »
The best and most up-to-date documentation is the source code itself.

Add gvector to the uses clause of your or a dummy project. CTRL+leftclick on "gvector", and Lazarus will open the unit in the source editor. There are not too many methods of TVector. Most of them are clear by just reading their name. Some of them were not clear to me: What is "Front" and "Back"? Select "Front" in the interface section, press CTRL+SHIFT+ArrowDown to go to the implementation, and from there I learned that the funtion Front returns just the first vector element. Similarly with Back - it is the last vector element.

Once you are used to this kind of navigation through the sources you will need documentation only in a few cases.

Handoko

  • Hero Member
  • *****
  • Posts: 5151
  • My goal: build my own game engine using Lazarus
Re: Where is the documentation for TVector?
« Reply #3 on: July 06, 2018, 01:32:09 pm »
Yes, it is very true. I use the tricks wp said and I rarely need to read 'other' documentation.

RayoGlauco

  • Full Member
  • ***
  • Posts: 179
  • Beers: 1567
Re: Where is the documentation for TVector?
« Reply #4 on: July 06, 2018, 02:11:47 pm »
I'm another one who often navigates through the source code instead of looking for documentation.  :)
To err is human, but to really mess things up, you need a computer.

Handoko

  • Hero Member
  • *****
  • Posts: 5151
  • My goal: build my own game engine using Lazarus
Re: Where is the documentation for TVector?
« Reply #5 on: July 06, 2018, 02:15:21 pm »
Can anyone write a wiki page about it, so I can recommend the page to newbies. I often wanted to tell them about the tricks but it's a bit hard for me to explain using words.

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: Where is the documentation for TVector?
« Reply #6 on: July 06, 2018, 03:08:36 pm »
Can anyone write a wiki page about it, so I can recommend the page to newbies. I often wanted to tell them about the tricks but it's a bit hard for me to explain using words.
https://en.wikipedia.org/wiki/Array_programming
Is that enough? :D :)
I mean it is trivial to write a Pascal example (and add it to Wikipedia) but it won't add to simple theory.
« Last Edit: July 06, 2018, 03:16:40 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Handoko

  • Hero Member
  • *****
  • Posts: 5151
  • My goal: build my own game engine using Lazarus
Re: Where is the documentation for TVector?
« Reply #7 on: July 06, 2018, 03:20:10 pm »
You misunderstood what I meant. I meant a wiki page explaining how to navigate through the source code in Lazarus IDE editor, not about TVector.

ricardo_sdl

  • New Member
  • *
  • Posts: 21
Re: Where is the documentation for TVector?
« Reply #8 on: July 06, 2018, 03:30:36 pm »
The best and most up-to-date documentation is the source code itself.

Add gvector to the uses clause of your or a dummy project. CTRL+leftclick on "gvector", and Lazarus will open the unit in the source editor. There are not too many methods of TVector. Most of them are clear by just reading their name. Some of them were not clear to me: What is "Front" and "Back"? Select "Front" in the interface section, press CTRL+SHIFT+ArrowDown to go to the implementation, and from there I learned that the funtion Front returns just the first vector element. Similarly with Back - it is the last vector element.

Once you are used to this kind of navigation through the sources you will need documentation only in a few cases.

That is what I ended up doing  :). Thank you all for the answers!

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: Where is the documentation for TVector?
« Reply #9 on: July 06, 2018, 04:02:39 pm »
You misunderstood what I meant. I meant a wiki page explaining how to navigate through the source code in Lazarus IDE editor, not about TVector.
Well, Bahasa Indonesia is not widely spoken over here, but I grew up with it. So I understand old school.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Handoko

  • Hero Member
  • *****
  • Posts: 5151
  • My goal: build my own game engine using Lazarus
Re: Where is the documentation for TVector?
« Reply #10 on: July 06, 2018, 04:54:17 pm »
Wow, that's interesting.

"Selamat malam Pak Thaddy."  :)

Thaddy

  • Hero Member
  • *****
  • Posts: 14369
  • Sensorship about opinions does not belong here.
Re: Where is the documentation for TVector?
« Reply #11 on: July 06, 2018, 05:23:40 pm »
Terima kasih.
« Last Edit: July 06, 2018, 05:25:41 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Where is the documentation for TVector?
« Reply #12 on: July 06, 2018, 07:04:45 pm »
Where can I find the documentation for the class TVector (defined inside the unit gvector)? I couldn't find any, at least nothing like there is for TBits(https://www.freepascal.org/docs-html/rtl/classes/tbits.html) for example.
https://svn.freepascal.org/svn/fpc/tags/release_3_0_4/packages/fcl-stl/doc/
Get the PDF if you don't want to compile the LaTeX source code yourself. This package is a donation, hence the original documentation is not written in fpdoc like TBits.

ricardo_sdl

  • New Member
  • *
  • Posts: 21
Re: Where is the documentation for TVector?
« Reply #13 on: July 08, 2018, 11:28:12 pm »
Very much apreciated Leledumbo!

del

  • Sr. Member
  • ****
  • Posts: 258
Re: Where is the documentation for TVector?
« Reply #14 on: October 16, 2019, 11:36:20 pm »
Pretty much the store brand of std::vector. Here's another:

https://docs.wxwidgets.org/3.0/classwx_vector_3_01_t_01_4.html

Very handy. I was brought here by Google cuz I'm using it for an expanding array of UnicodeString.


 

TinyPortal © 2005-2018