Forum > Beginners
[SOLVED] Program Examples
WickedDum:
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 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Program Example38; { This program demonstrates the FileExists function } Uses sysutils; Begin If FileExists(ParamStr(0)) Then Writeln ('All is well, I seem to exist.');End.
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. :)
Ñuño_Martínez:
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".
Handoko:
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:
--- Quote from: Handoko on September 12, 2016, 12:42:24 pm ---Complete runable Pascal program examples are rare to find.
--- End quote ---
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 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Program Example38;{$apptype console}{ This program demonstrates the FileExists function } Uses sysutils; Begin If FileExists(ParamStr(0)) Then Writeln ('All is well, I seem to exist.');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)
Handoko:
Did you mean if someone asking help in this forum, we should answer it with full compile-able and run-able code?
Navigation
[0] Message Index
[#] Next page