* * *

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

ricardo_sdl

  • New member
  • *
  • Posts: 19
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: 819
    • 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: 5045
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.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Handoko

  • Hero Member
  • *****
  • Posts: 2640
  • 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

  • Jr. Member
  • **
  • Posts: 82
  • 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: 2640
  • 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: 7136
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 »
inline variables like in D10.3 are a bit like Brexit: if you are given the wrong information it sounds like a good idea. Every kid loves candy, but it makes you fat and your teeth will disappear.

Handoko

  • Hero Member
  • *****
  • Posts: 2640
  • 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: 19
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: 7136
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.
inline variables like in D10.3 are a bit like Brexit: if you are given the wrong information it sounds like a good idea. Every kid loves candy, but it makes you fat and your teeth will disappear.

Handoko

  • Hero Member
  • *****
  • Posts: 2640
  • 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: 7136
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 »
inline variables like in D10.3 are a bit like Brexit: if you are given the wrong information it sounds like a good idea. Every kid loves candy, but it makes you fat and your teeth will disappear.

Leledumbo

  • Hero Member
  • *****
  • Posts: 7971
  • 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: 19
Re: Where is the documentation for TVector?
« Reply #13 on: July 08, 2018, 11:28:12 pm »
Very much apreciated Leledumbo!

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus