Click here to Skip to main content
15,867,308 members
Everything / Programming Languages / Pascal

Pascal

Pascal

Great Reads

by Chris Boss
Why some prefer the BASIC language over others
by José Cintra
Some suggestions of algorithms for solving the Pascal Triangle, addressing iterative, recursive and functional paradigms
by RickZeeland
Make installations simpler with Inno Setup [Tasks]
by nortee
This will allow you to create a configuration file in either INI or XML format minus all the hard work in Delphi.

Latest Articles

by RickZeeland
Make installations simpler with Inno Setup [Tasks]
by ToughDev
Revisiting Mario Game Written in Pascal
by ToughDev
A look at Borland Turbo C/C++
by ADMGNS
A very simple method to resampling points from a digital image and drawing it as antique mosaics, dots (stippling) and Voronoi cells

All Articles

Sort by Score

Pascal 

23 Aug 2018 by Chris Boss
Why some prefer the BASIC language over others
18 Aug 2014 by José Cintra
Some suggestions of algorithms for solving the Pascal Triangle, addressing iterative, recursive and functional paradigms
18 Oct 2023 by RickZeeland
Make installations simpler with Inno Setup [Tasks]
22 Nov 2011 by nortee
This will allow you to create a configuration file in either INI or XML format minus all the hard work in Delphi.
22 Apr 2022 by ADMGNS
A very simple method to resampling points from a digital image and drawing it as antique mosaics, dots (stippling) and Voronoi cells
24 Aug 2014 by José Cintra
Some suggestions of algorithms for computing the Fibonacci numbers addressing iterative, recursive and functional paradigms
12 Sep 2018 by Chris Boss
A short introduction to using the Powerbasic 6.0 console compiler with the Ontime RTOS-32 embedded operating system
29 Dec 2013 by Richard MacCutchan
Google finds http://www.amath.unc.edu/sysadmin/DOC4.0/pascal/lang_ref/ref_assign.doc.html[^] among others. MSDN has http://msdn.microsoft.com/en-us/library/x04xhy0h.aspx[^].
7 Jun 2011 by OriginalGriff
First rules:1) We need the error message, or some idea of what the error is.2) Indentation helps you (and us!) to actually read the code. At the moment, it is a mess - tidy it up so we can easily see what is going on.3) Don't use goto in Pascal and then ask for help unless it is absolutely...
17 Dec 2012 by User 8984948
Pascal Server Pages
24 Jan 2014 by CPallini
You should report the exact error messages, on order to get help.I tried to compile it with Free Pascal Compiler, getting:filetext.pas(12,13) Error: Incompatible types: got "Char" expected "Int64"filetext.pas(19,10) Error: Illegal qualifierfiletext.pas(20,9) Error: Illegal...
25 Jan 2014 by OriginalGriff
Because seekEoln[^] returns true if it is at the end of a line. Which it won't be the first time you enter the loop in your sth procedure, but will be immediately after calling readln...And please, do yourself a favor: learn to indent your code so it is at least partly readable? It'll make...
28 Jan 2014 by CPallini
Error 216 is a general protection fault. Probably a memory error in your case. For instance, count is declared (and used) as an array, but you never allocated memory for it.
1 Mar 2014 by nv3
The largest amount of time in your program is taken up by the input and output functions. So what you are measuring is that the input/output system of your pascal implementation is obviously much faster than the input/output system of your C implementation. That is not really surprising, because...
1 Mar 2014 by RSpates
You asked: 2) why can't I declare big static arrays ?1. Your two programs are not equivalent.2. Your array definitions in the C++ code aren't static - all three are declared on the stack. That's a no-no for stuff this large for several reasons. If you want arrays that large,...
11 Apr 2014 by CPallini
What is the problem of the [100,200] arrangment (or of the opposite one) ?If you access the items in a consistent manner, every arrangment is valid. After all the space is isotropic, isn't it? :-)
3 Jun 2014 by E.F. Nijboer
It wouldn't strengthen it. The reason for the random salt is to prevent creating a rainbow table. If you use a derived salt you would weaken the encryption. For example, it would render the result of GetSalt("Foo") to be "Bar". But it would always be "Bar"! There is nothing random about...
2 Jan 2016 by Matt Comb
uses Windows, PsAPI, SysUtils;const SE_SECURITY_NAME = 'SeSecurityPrivilege'; PROC_THREAD_ATTRIBUTE_PARENT_PROCESS = $00020000; EXTENDED_STARTUPINFO_PRESENT = $00080000;type PPROC_THREAD_ATTRIBUTE_LIST = Pointer; STARTUPINFOEX = packed...
18 Feb 2016 by Jochen Arndt
Why you are using some kind of DLL to access an USB mouse instead of using the Delphi mouse events that use the Windows API?The mcHID DLL is for accessing USB devices on a low level.I have not used Delphi so far, but a quick research shows that there is an OnMouseMove event. If you need...
25 Apr 2016 by Jochen Arndt
If you want to check if the key exists and read the current value, you must use Pascal Scripting[^] in the [Code][^] section. However, this requires that you become familiar with the Pascal scripting used by Inno Setup.The function to read a string value from the registry is...
19 Aug 2016 by TimGallin
The innosetup's wizard UI is too old,i want to create a custompage.I know that i can use CreateCustomPage function or a custom dll to do this till the present moment,but i'm not very familiar with PASCAL and the offical examples are not very complete.Is there someone had made a custom page or...
19 Aug 2016 by Maciej Los
Please, refer Inno Setup Knowledge Base[^]More you can find via Google[^], for example:installer - Custom Page Wizard of Inno Setup - Stack Overflow[^]How can I create my own form or page in an Inno setup based installer? - Stack Overflow[^]Inno Setup custom page - Stack Overflow[^]
7 Oct 2016 by Mehdi Gholam
Security risks in programs is a function of the complexity of the application ( the more complex the app the more chance of security risks) this includes the whole stack that is used from the OS up.Generally virtual machine languages (sand-boxed) are more secure like .net java etc. by the...
26 Feb 2019 by OriginalGriff
If your background is very old Pascal and HTML, then I wouldn't start with C++ to be honest - I'd start with C# instead. It's a simpler language, which is tightly bound to the .NET framework, which means that what you want to do becomes pretty simple. Create a WinForms app, drop a PictureBox...
30 Jun 2019 by Super Lloyd
May I suggest an alternative idea? On one hand it's a perfectly valid query. On the other you might want to consider trying C#? It might seem overkill, since you'll be starting from a position of knowing nothing... But, as you no doubt realise, there are tons of helpful C# resource on this...
30 Jun 2019 by CPallini
There are better alternatives, nowdays. As already suggested you could use C#. Another choice could be Python (see, for instance Program Arcade Games With Python And Pygame[^]). I know this is side-stepping your question, but it is, in my opinion, for the good. It is better to teach your kids...
1 Oct 2020 by CPallini
Quote: 1) Is there any version of Pascal out there that will allow me to finish such program? You may try Lazarus[^]. Quote: 2) should I expect any help for this language in this forum? or at all Since it is your favourite language, you're...
25 Nov 2020 by OriginalGriff
You're running late - the rest of your class was trying to get us to do this homework last week ... But I'll tell you what we told them: Quote: We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it...
28 Apr 2021 by Rick York
This is not a code conversion service but I will give you a hint. The Pascal for loop of this form : for x1 :=0 to 12 do looks like this in c++ : for( x1 = 0; x1
17 Jan 2022 by OriginalGriff
All it does is mask and shift values: Look up the AND and shr operators and it's pretty obvious: Pascal - Bit Operators[^]
17 Jan 2022 by CPallini
public static byte [] getNibbles(UInt32 ui32) { const int Nibbles = 8; byte [] b = new byte[Nibbles]; for ( int n=0; n>= 4; } return b; }
30 Dec 2010 by malemar
In this code can I make the number and operation in one line such as 22+3/5=:confused:and I want introduction, Purpose and conclusion :rolleyes: program calculator_in_pascal;var x : integer; num1 , num2 , ms , amo : real; ope , ord : char; cho : string;begin num1...
17 Jan 2011 by Sandeep Mewara
Stick to this question of yours[^].You don't need to repost your question. Further, asking of code would not be encouraged. Other question already shows your effort and one who knows would surely try to help. :thumbsup:
23 Jan 2011 by G C Sraty
I am trying to access an on-board parallel port using Pascal in WinXP. I have written the port write/read code using Inline ASM code and invoked "Allowio" on the Pascal program. I write bytes to the port (in this case 0x378) but find that only the two (2) least significant data bits respond....
7 Jun 2011 by ahmadpico
I need help with the program below. I wrote it with pascal lung and, when I compiled it with micro pascal to hex files, there is an error and I need some help to find it.Thank youProgram programme;Var l,i:longint;Label...
7 Jun 2011 by ahmadpico
OK this program about a solar tracker with pic16f876 when i compiled the program in micro pascal compiler i see this errors Program programme;Var l,i:longint;Label L1;begintrisb:=$FC;trisc:=$FF;trisa:=$FF;ADCON1:=$8E;portb:=0;while (true)...
7 Jun 2011 by Sergey Alexandrovich Kryukov
You're not reporting properly. You're showing compile-time errors (you need to mention that). What is "1 304"? Is that column/line numbers? You don't show the code lines with the errors. You need to show them and add comments where the errors are.Now, your problem is non-ASCII characters in...
31 Jul 2011 by Richard MacCutchan
this[^]?
22 Feb 2012 by Sergey Alexandrovich Kryukov
There is no such universal concept as "reset". You should develop some semantic procedure changing the state of the application, that's it.—SA
4 Apr 2012 by vincaslt
How to find a lowest value of sort?I have an array of integers and I need to sort it low->high.I need to know the lowest count of swapped number values, i.e :I have 7469 -> 4697 - Lowest value is 7, as 4+6+9 is more.7123 would be 6, as 1+2+3
4 Apr 2012 by barneyman
looks like you want the Bubble Sort[^]
27 Nov 2012 by lilyNaz
I have written a code in C++ builder in which I use header FileCtrl.hpp and I call SelectDirectory procedure so that the user can choose the a directory. When I change the drive to empty floppy disk or DVD drives, I get Exception EInOutError. I used try catch, bu it didn't work.try{ ...
29 Nov 2012 by Dharmateja Challa
To trap EInOutError enable "I/O checking" in the Pascal tab of the project options in order for EInOutError exceptions to be trapped. It seems EInOutError is a delphi class
22 Dec 2012 by lilyNaz
I used SHBrowseFolder instead and everything turned out OK.
22 Feb 2013 by OriginalGriff
It's been a long while since I used Pascal, but...have you tried with brackets?if ((x[i]
17 Sep 2013 by Lubomur
Text analisator, for example we have input string: "y = (x^2)/2", how can we calculate that in any language(C++, C#, C or Pascal)?Some C++ prototype:...object = new string_analisator_object->set("y = (x^2)/2");...double y = 0;double x = 0;...Ofcourse we know that is a...
10 Oct 2013 by Milos S.
Hi,im trying to create a parser for excel to generate a pricelist from a csv file.Im doing this with a parser and a generator. To get all the devices containered, i've created a device object and want to list the accessories in it but i have a problem.unit Device;interface uses ...
29 Dec 2013 by hor_313
HiI want to know what is the mean of these operators in pascal language , and what is the equal of them in C language ?Thank you
9 Jan 2014 by Member 10446575
Actually i done one project in morfik software now i was build that has a .exe and .dll also but i know dll not impossible to run.thats'y asking can i run .exe file.
15 Jan 2014 by Member 10526961
Hi,I have copied some example code for a program that Exchanges data over a network. I am using delphi 7 as my IDE. I get no errors when running the programI have two seperate applications, one for the server and one for the client.Here is the Source code for the server:procedure...
21 Jan 2014 by Member 10538783
Hello, well, the following program opens a file and reads the first two strings that exist in the first line into two variables. The problem is that I’ve been trying to see what’s wrong with the following program, but I can’t see why it’s not working.The compiler compiles it without any...
21 Jan 2014 by CPallini
Quote:repeatReset(f);until eof(f);This sequence looks wrong to me.
21 Jan 2014 by Member 10538783
I wrote it like that, so as to open the file once, only in the main program, there it is.Program num;Varf:Text;b,g:String;c:String[1];Procedure thenum (a:String);BeginAssign(f,'textfileoffile.txt');Reset(f);a:='A';while not eof(f) and (a' ') dobeginRead...
22 Jan 2014 by Member 10538783
Thank you very much, the program now, works without any problem at all.
24 Jan 2014 by Member 10538783
Hello, well i've been trying to make a program a program that will read from a text file the first num. of the firs line, and then will do a certain procedure, that means a procedura that will read the other nums. into arrays, as many times as the value of the first num is. This is the program...
25 Jan 2014 by Member 10538783
Hello, can anyone help me with the following program? The problem seems to be in variable c, but it doesn't seems wrong to me. Can anyone please help me?The text that the program reads is like this3 21 21 31 2Where 3 is n , so the procedure the program must be done 3 times, so...
25 Jan 2014 by Kornfeld Eliyahu Peter
If the code as you posted, than you have a syntax error (case) here:procedure space;beginRead(f,c[i]);Write(c[i]);end;It should beProcedure space;beginRead(f,c[i]);Write(c[i]);end;
28 Jan 2014 by Member 10538783
Hello, i have to make this program, but i still haven't finished it and i need some help. This is what i have to do. Make a program in Pascal that after has read a text with a list of nums., it will return the numb. of the nums that appear less than one times in the text.The text that will...
28 Jan 2014 by Member 10538783
Hello, this is my program, there is no compiler message, but at the runtime it exits, can anyone please help me? program MyProgr; var F: text; t:Textfile; a,count:array of Integer; b:Integer; i,int:Integer; ...
28 Jan 2014 by Kornfeld Eliyahu Peter
Your count array has no dimensions! So assigning values to its element is a memory violation...
28 Jan 2014 by Member 10538783
Hi, i have to do the following thing. Make a program in Pascal that after has read a text with a list of nums., it will return the numb. of the nums that appear less than one times in the text.The text that will be read from the program should be like that.In the first line there are...
6 Mar 2014 by bling
That's a good start. Each time a row is eliminated, it may have also eliminated multiple columns (and vice versa).After each round where Bessie clears a row or column with her cannon, you will need to recompute your row max and column max values. Consider an asteroid map where the first...
30 Jun 2017 by Árpád Kocsis
I am learning Pascal in school, but i was reading alot about it that it is not used nowdays. So Should i learn python or Java as my first programming language, and learn pascal in school for the only reason to get a good grade? Or should i just Learn Pascal(Lazarus) and learn another language...
10 Apr 2014 by EbolaHost
Say that I have a grid of coordinates...x goes from 0 to 100 and y goes from 0 to 200.I want to store info about each point in an array...however if I declare an array[100,200] the array eill be 100 in height and 200 in width,while the grid is the opposite So at an exercise they want me to...
3 Jun 2014 by UweOeder
Hi does somebody have some demo code preferably in C# or secondly in Delphi/Pascal on how I could implement Key Strengthening and not Key Stretching like it is explained on Wikipedia. My Idea was using a random or cryptographic random function to generate x amount of bytes(SALT).However...
9 Jun 2014 by UweOeder
I think I will attempt to solve this in the following way.Step.1 Get KEY form user.Step.2 Generate random SALT.Step.3 Use KEY and SALT for whatever cryptographic purpose.Step.4 Hash SALT. (Any SHA-3 hash should suffice.)Step.5 Encrypt Hash with KEY.Step.6 Permanently delete...
16 Aug 2014 by Richard MacCutchan
See http://en.wikipedia.org/wiki/Pascal's_triangle[^]. You need to create an algorithm based on the rules for the triangle. Once you have the algorithm then you just need to convert it to code.
17 Aug 2014 by Satya Chamakuri
Hi, I think, the output what you are displaying is not a pascal triangle & to print that out put what you written is not required, its hardly 4 lines of code...
29 Oct 2014 by Karozzi
I want to know the best tools to unpack Inno Setup-based installers and recover the script and installer files of any IS installer. Im currently using InnoExtractor application. If you know other similar ways/applications please let me know.Thanks in advance!
7 Nov 2014 by Member 10526961
The following is the code for a minesweeper project. In the ApplyBlocks procedure, I want to check all adjacent blocks (blocks are stored in a two-dim array as coordinates), and if any are bombs (or = 9), then increase there value by 1. Unfortunately I can not get this to cork and I do not...
3 Jan 2015 by Member 11350283
please help me to get it !although the pseudocode is enough for me .
3 Jan 2015 by Richard MacCutchan
Try https://www.google.com/search?q=additive%20phylogeny[^].
15 Mar 2015 by Afzaal Ahmad Zeeshan
No -- this is pretty much off-topic as per this website. Try it yourself.
22 Mar 2015 by Member 11545132
I'm new to C++, previously I used Pascal. So, I did this exercise in Pascal and I'm interested in the way how this looks in C++. I only know the basic things in C++: arrays, loop stuff etc. Here's the Pascal code:program asd; uses crt; var letters: set of 'A'..'Z'; kar:...
22 Mar 2015 by OriginalGriff
So code it up in C++ and try it out.We'll happily criticise what you did, but we aren't going to convert it for you!
5 Jul 2015 by mr.abzadeh
Hello guys.I have a DLL containing this function:function DCL_Initialize(bDeviceID: Byte; sIP: PAnsiChar): Byte; stdcall external 'DCL.dll';now I want to call this function from C as this(somewhat simplified):#define DLL_EXPORT __declspec(dllexport) __stdcalltypedef char DLL_IMPORT...
2 Jul 2015 by E.F. Nijboer
The pascal convention seems to be obsolete. Check here for more info:https://msdn.microsoft.com/en-us/library/wda6h6df.aspx[^]Good luck!
2 Jul 2015 by Frankie-C
You have to simply provide a prototype for the function to call that is equivalent to PASCAL function.In your case it should be:#pragma comment(lib, "DCL.lib")#ifdef __cplusplusextern "C" {#endifchar __declspec(dllimport) WINAPI DCL_Initialize(char bDeviceID, char *sIP);#ifdef...
4 Jul 2015 by Richard MacCutchan
See https://www.sqlite.org/lang_datefunc.html[^]; myDate should be a string value of a date.
17 Aug 2015 by Nafees Hassan
I am making a DLL for creating GUIs and this is how I have planned for it to work:1. Application calls the DLL function to create a form with a button on it2. DLL creates a form in a new thread(so the application doesn't get stuck)3. Application has to show a message whenever(not just...
19 Nov 2015 by BillWoodruff
The .LOL! file always begins with a joke whose length will vary, and then may include a structured 4D-Six-Sigma XML hierarchic matrix of a number of links to bitmaps, each link describing the bitmap format, resolution, and, optionally, including the actual bits of the bitmap as a binary BLOB in...
2 Jan 2016 by Matt Comb
Theres a few ways you could solve this:1. Send a Windows Message back to the mainform and have the mainform listen for it.2. Use sockets e.g. UDP to send a message back to the main application.3. Display the popup message directly from the DLL.
2 Jan 2016 by Matt Comb
These lines: if aBlocks[ix-1,iy-WIDTHQ] = 9 then BlockNumber := BlockNumber+1; if aBlocks[ix,iy-WIDTHQ] = 9 then BlockNumber := BlockNumber+1; if aBlocks[ix+1,iy-WIDTHQ] = 9 then BlockNumber := BlockNumber+1; if aBlocks[ix-1,iy] = 9 then BlockNumber...
8 Apr 2016 by Patrice T
Quote:I haven't tried an awful lot as i don't have the knowledge to do much!There is not much to try, read the error message. [Error] OfflinesUnit.pas(103): Undeclared identifier: 'LoadString' [Error] OfflinesUnit.pas(142): Undeclared identifier: 'LoadString'It tells you that LoadString...
25 Apr 2016 by Member 11648410
Root: HKLM; Subkey: "SOFTWARE\xxx\yyy"; ValueType: string ; ValueName: "KEYNAME"; ValueData: "{olddata};C:\x\y\z.dllI am using this line of code in inno setup to open the registry path and add a.dll at the enf of the existing data. How to check if the registry value has the dll name which i...
3 Feb 2022 by Member 8816170
I am interested in making a compiler for IEC 61131 Structured Text to target an ARM processor. I want the code generator output to be in C++. Then I plan on using GCC C++ to ARM. I already have C++ code for ARM to act as a runtime.The PC program tool of choice is C# and I was looking at...
1 Jun 2016 by Garth J Lancaster
I'm not sure what (particularly the 2nd sentence) in Quote:Then I plan on using GCC C++ to ARM. I already have C++ code for ARM to act as a runtime. means - can you elaborate ?Certainly I see no real issue using Antlr or COCO/R or ? to take IEC 61131 Structured Text, and build a 'parse...
8 Jun 2016 by Member 12551108
I have some FPC code. The problem, is that it takes two (2) presses of the down arrow key to get to the "bot_bar" procedure.procedure oneliners;var Twriters : array[1..10] of string;var Toneliner : array[1..10] of string;var S : string;var Foneline : string;var ...
26 Oct 2016 by integragreg
Have a look at the Eclipse Xtext project. Once you have your grammar defined, you can write a generator pretty easily that will generate the C++ code based on your AST.
3 Apr 2017 by Member 13102568
I have a form which I need the user to be able to print but I only want a certain region of the form printed. Is there a way I can select a certain region (without the user having to) and only print that? What I have tried: procedure TForm1.Button1Click(Sender: TObject); var printDialog :...
3 Apr 2017 by Member 13102568
I have TButtons which the user can create at runtime. When they are created the button is added to its own TObjectlist depending on which button they create. I believe the list stores all the properties of the button. The first code is where the button is created and added to its own...
8 May 2017 by Richard MacCutchan
You need to check the Lazarus documentation. Lazarus Homepage[^]
31 Dec 2017 by kkdxghlctlcxxtidyuum
Hello, After installing a new distribution of GNU/Linux, I found that various applications were using a different icon set for their MenuStrips and ToolBars. My old distribution used the GTK+ icon set (Debian), my new distribution uses the Mint-X icon set (Linux Mint). My question is: how does...
4 Jan 2018 by Member 13608224
Hi! So i would like to ask if you have any idea how to make a diagonal latin square (i mean a square that has combination of 1..n not only in row and column but also on both diagonal and antidiagonal). I've tried a lot of things but it just doesnt want to work. The worst thing is that i found...
4 Jan 2018 by Maciej Los
You can't expect that someone of us will write a programme to you. Start here: Latin Square -- from Wolfram MathWorld[^]. A diagram which may help you to write programme, you'll find here (pdf)[^]