Recent

Author Topic: [SOLVED] Program Examples  (Read 6190 times)

WickedDum

  • Full Member
  • ***
  • Posts: 211
[SOLVED] Program Examples
« on: September 01, 2016, 08:44:21 pm »
At the bottom of the page of following url: http://www.freepascal.org/docs-html/rtl/sysutils/fileexists.html there exists "Program Example38:"

Code: Pascal  [Select][+][-]
  1. Program Example38;
  2.  
  3. { This program demonstrates the FileExists function }
  4.  
  5. Uses sysutils;
  6.  
  7. Begin
  8.   If FileExists(ParamStr(0)) Then
  9.     Writeln ('All is well, I seem to exist.');
  10. End.
  11.  

I have run across a multitude of different examples in my readings.  Is there an index or maybe just a listing of all of the program examples available within the documentation?

Thank, in advance, for your time and assistance. :)
« Last Edit: September 13, 2016, 06:09:20 am by WickedDum »
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1216
    • Burdjia
Re: Program Examples
« Reply #1 on: September 12, 2016, 11:08:35 am »
Not as far as I know.  Anyway, most examples included in documentation are code snippets without actual purpose.  You should read them when read the description to know the "context".
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Handoko

  • Hero Member
  • *****
  • Posts: 5487
  • My goal: build my own game engine using Lazarus
Re: Program Examples
« Reply #2 on: September 12, 2016, 12:42:24 pm »
Complete runable Pascal program examples are rare to find.

But if you want to see code examples, here has wide range of topics:
http://wiki.freepascal.org/Lazarus_Documentation#Lazarus_and_Pascal_Tutorials

Here has collection of examples programs for different languages:
http://rosettacode.org/wiki/Category:Pascal

Here has video tutorials suitable for beginners:
http://forum.lazarus.freepascal.org/index.php/topic,33667.msg221339/topicseen.html#new

Thaddy

  • Hero Member
  • *****
  • Posts: 18344
  • Here stood a man who saw the Elbe and jumped it.
Re: Program Examples
« Reply #3 on: September 12, 2016, 03:00:26 pm »
Complete runable Pascal program examples are rare to find.
Yes, only a couple of million. What is that remark?

BTW: it is a complete compilable example, just not  on the minor platform that is called "Windows". 8-)
Then it should read:
Code: Pascal  [Select][+][-]
  1. Program Example38;
  2. {$apptype console}
  3. { This program demonstrates the FileExists function }
  4.  
  5. Uses sysutils;
  6.  
  7. Begin
  8.   If FileExists(ParamStr(0)) Then
  9.     Writeln ('All is well, I seem to exist.');
  10. End.

If everybody should show some discipline (like others and me) to provide real code examples the world would look brighter.
But most of the experienced users here do that already.

This forum is litteraly littered with compilable code examples... Or did you miss one or two ;) O:-)

Same goes with the official FPC manuals (Lazarus lags a couple of 100 years behind, imnsho)
« Last Edit: September 12, 2016, 03:18:03 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Handoko

  • Hero Member
  • *****
  • Posts: 5487
  • My goal: build my own game engine using Lazarus
Re: Program Examples
« Reply #4 on: September 12, 2016, 03:31:00 pm »
Did you mean if someone asking help in this forum, we should answer it with full compile-able and run-able code?

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: Program Examples
« Reply #5 on: September 12, 2016, 03:50:17 pm »
Thank you all for your posts!  Great information!

You should read them when read the description to know the "context".
Of course I do.  But, as an example, I have always tried to use understandable variables.  Of course! :D

During my readings on the document pages, some of the examples are not intuitive...to me.  Hence, my login name.  :(

@Handoko - I have tried the links.  Thanks!  I could spend a lot of time (that I shouldn't) on the rosettacode.org.

@Thaddy - My "minor" domain is not my problem. :D  An example, if I may, Program 38.  Compilable?  Great!!  But, where is the parameter?  Is it only functional as a console program?  My personal task at hand is learning the IDE for GUI programs, not the console.  I have more LOC for the console than I care to acknowledge!  I have a moderate understanding of Pascal, but this IDE is driving me nuts!!   %)

As for "full compile-able and run-able code", of course not. 

I was specifically asking about "an index or maybe just a listing" of the 'Program Examplenn's at the bottom of the document pages.

Thanks, again, for your posts!

Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

Handoko

  • Hero Member
  • *****
  • Posts: 5487
  • My goal: build my own game engine using Lazarus
Re: Program Examples
« Reply #6 on: September 12, 2016, 03:59:32 pm »
I have a moderate understanding of Pascal, but this IDE is driving me nuts!!   %)

Lazarus IDE isn't that bad, is it? Can you share some advice where the IDE can be improved?

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: Program Examples
« Reply #7 on: September 13, 2016, 03:27:00 am »
@Handoko - Can I share some advice where the IDE can be improved?  Uhhhh...

Allow me to digress:  I started Pascal with Turbo 3; then 4; then 5.  Then Ada on a mainframe and then on a PC with a maximum of 16mb of memory; earned my MS in Software Engineering.  After thousands of LOC, I went into systems engineering; network engineering; then IT and communications project management.  I now be retired.  I want to write some programs!  My problem is that the world went GUI (with something called the Internet) while I was still in a text frame of mind...   :(

Now - current day.  My programs need to have a GUI interface - something that is second-nature for the user.  I studied web pages, HTML, CSS, WPF, and C#.  I decided I should go back to the basics and just program in Pascal.  So, here I am! 

I can barely spell Lazarus, let alone know where to improve it.  I would LOVE a tutorial on Lazarus.  There are many, many tutorials and examples of code for Pascal; FPC or otherwise.  That is not my problem.

My problem is that the IDE is not intuitive to me.  (Visual Studio and/or Embarcadero is not, either.)  I have never had so much trouble composing a screen!!  (OK, in FPC jargon:  a form.)   :-[

I printed out all of the components, laminated it, and have it right here by me.  That is a quicker reference for me than selecting each tab.  The only item closer to me than the list of components is my hard copy of LAZARUS The Complete Guide.  And I have dual screens:  The forum and freepascal.org/docs-html on my left and Lazarus on my right.

When I get to the point I can contribute meaningful suggestions/solutions, I will.  I have had a lot of help from the forum.  I need to return the favor.  I look forward to being able to post solutions instead of problems.  :)

Meanwhile...I figured an index to or list of the example programs in the documentation might be helpful to me.  Thus, my initial post.
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

Handoko

  • Hero Member
  • *****
  • Posts: 5487
  • My goal: build my own game engine using Lazarus
Re: Program Examples
« Reply #8 on: September 13, 2016, 04:26:37 am »
@Handoko - Can I share some advice where the IDE can be improved?

Of course you can.

http://wiki.freepascal.org/Feature_Ideas

You can start a new thread and know how others think about your idea here in this forum. Also, you can join the mailing list:

http://www.freepascal.org/maillist.var

But, if you think the IDE doesn't work correctly as what it should be, you may consider to report it on the bug tracker:

http://bugs.freepascal.org/view_all_bug_page.php

You should know, not every improvement suggestion will be accepted. Some may not agree with your idea. If a good idea isn't implemented, it's not because it is not accepted. It can be no one is working for it, because Lazarus/FPC is a volunteered project. So, if you're good in programmig, you can write a patch and submit it.

Have fun.

Edited:
If you want to learn more about Lazarus IDE, this link may be useful:
http://wiki.freepascal.org/Lazarus_Documentation#IDE
« Last Edit: September 13, 2016, 04:31:12 am by Handoko »

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: Program Examples
« Reply #9 on: September 13, 2016, 06:08:30 am »
@Handoko....  You asked me if I could make improvements, I said "Uhhhhh..."  I was just referencing your question.  Sorry for the confusion.  It will be a while before I have anything to contribute.  :|

The last link (http://wiki.freepascal.org/Lazarus_Documentation#IDE) is GREAT!!!!  It has provided me hours of reading so far...and many more to go!!

Thank you VERY much for the link!!!  I can sleep well tonight.   :D
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

 

TinyPortal © 2005-2018