Questions tagged [pascal]

Pascal is an imperative language from the Wirthian family created in 1969. It was widely used in engineering and teaching in the 1970s and 1980s. It lives on in compilers as Free Pascal and Delphi.

Pascal is an influential imperative and procedural programming language, designed in 1969 and published in 1970 by Niklaus Wirth as a small and efficient language. It was largely (but not exclusively) intended to teach students structured programming and data structuring.

Pascal is a descendant of , but it was implemented on a wide range of architectures, from PDP-11s, IBM PCs, to CDC Cyber and IBM System 370 mainframes. Pascal probably reached critical mass around the time Borland released Turbo Pascal in 1983.

Wirth later developed Modula-2 and Oberon and those languages share much of Pascal's design. Other derivatives include OOP-based Object Pascal (used in Delphi and Lazarus/Free Pascal).

Pascal is a purely procedural language and includes control statements with reserved words such as if, then, else, while, for, and so on. However, Pascal also has many data structuring facilities and other abstractions not included in ALGOL 60 like type definitions, records, pointers, enumerations, and sets.

External Resources

Free Pascal/Delphi Programming Books

2598 questions
0
votes
1 answer

Catching FreePascal Exception in GDB

I have a huge pascal code compiled with fpc. I am getting random "EInOutError" exception and I am trying to debug it using gdb. I already tried break fpc_raiseexception, catch throw, catch exception, catch catch. Nothign seems to work... How can I…
André Puel
  • 8,741
  • 9
  • 52
  • 83
0
votes
1 answer

Excel crashes after calling a Pascal DLL

I have wrote a DLL in Free Pascal and want to call it in Excel. I would be grateful if someone can help me out. My Free Pascal DLL for testing is procedure chess(var number : single);stdcall; begin WriteLn(output,'Wir testen die Zahl: ',…
Idas
  • 19
  • 2
0
votes
1 answer

There is an invalid floating point operation, but where?

I'm currently writing a code the takes a number given a prints all the prime numbers that fit the format 4n+1. This is what I have so far. They problem is that this gives me a runtime error 207 which I think means invalid floating point operation,…
0
votes
2 answers

Enumerated type and registers

I'm having difficulties with some code, basically I need to fill 3 vectors that work as data storage, where every vector position correspond to a specific province, I'm sorry about the variable names being in spanish. CONST F = 24; …
0
votes
1 answer

Clearing a single space from the console

I don't know how to word the title correctly but I was wondering if there is any way for me to be able to clear a single space from the console instead of clearing the entire thing just to re-write it again? for example, say I was to draw out a 3 by…
0
votes
1 answer

why i get a strange result when summing 3 real variables?

here is my code: program P1; var a,b,c,p :real; var i,o,n: string; begin i := 'isoscel'; o := 'echilateral'; n :='scalen'; writeln('Introduceti 3 numerele reale'); readln(a,b,c); case (a>0) and (b>0) and (c>0) and (a+b>c) and (a+c>b) and…
0
votes
0 answers

Error in dbgrid painting when using DrawCell?

Bonjour. I am using kdbgrid from KControls for lazarus. 1- When i add this : procedure TForm1.KDBGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; R: TRect; State: TKGridDrawState); begin if (aCol <> 1) or (aRow = 0) then begin …
0
votes
3 answers

What does this Pascal syntax mean

Here's this code: for i:= 1 to n do Write(a[i]:6:2); Writeln; For loop outputs data from array.. Please, help - What does :6:2 in Write() mean? Thanks in advance!
DrStrangeLove
  • 11,227
  • 16
  • 59
  • 72
0
votes
1 answer

Are there Rust-like tuples in pascal?

Rust's tuples allow for an anonymous, packed, stack-allocated data-structure that holds multiple values. Example: let (a, b) = returns_tuple(); // fn returns_tuple() -> (i32, String); In (free) pascal i'd do it with a named record type, i guess,…
Soft Waffle
  • 356
  • 1
  • 12
0
votes
1 answer

Pascal binary search tree that contains linked lists

I need to search through its contents with a recursive function, so it returns a boolean response depending whether the value I read was found or not. I dunno how to make it work. Here's the type for the tree I defined: text=string[30]; …
Etto
  • 5
  • 1
  • 2
0
votes
2 answers

What is that the Error of Illegal assignment and how to correct it?

procedure tri_selection(t: tab; n: Integer); var i, j, min, aux: Integer; begin for i := 1 to n - 1 do begin min := i; for j := i + 1 to n do if t[j] < t[min] then j := min; if min <> i then begin aux :=…
0
votes
1 answer

how to make code less repetitive (pascal)

pos := IntToStr(comp1[5]); with TLabel (FindComponent('Labelc'+pos)) do Caption:=comp1n; with TLabel (FindComponent('Labelc'+pos+'w')) do Caption:=IntToStr(comp1[1]); with TLabel (FindComponent('Labelc'+pos+'l')) do…
1ayre0
  • 1
0
votes
0 answers

Does java have the same thing like pascal(type record...end) to sort data?

Like this title said, I want to make the same array like pascal in java. But is this possible to make in java? type personal = record name : string; year : smallint; sex : string; age :…
a1668k
  • 11
  • 2
0
votes
1 answer

How can move between the forms pages in Delphi using DBLookupComboBox

I have a question about a DBLookupComboBox component in Delphi. I want to move between the forms pages in the Delphi program using a DBLookupComboBox component. When I choose a name "ahmed" for example from the DBLookupComboBox list it will move to…
0
votes
1 answer

Assign a value to a nill pointer

I'm currently try to implement one way linked list using pascal but i'm kinda lost , below i tried to create a list before adding a node then assign nil to the last node but then when i'm trying adding a new node i can't access it (runtime error…
from_pluto
  • 21
  • 4
1 2 3
99
100