pascal

overload operator line 2 and 3, not compiling

program PROG15 (input,output); var invalid_operator : boolean; operator : char; number1, number2, result : real; procedure MULTIPLY; begin result := number1 * number2 end; procedure DIVIDE; begin result := number1 / number2 end; procedure ADD; begin result := number1 + numb...

Pascal error with array

program s; type info = record name, surname: string; min, sec: integer; end; arrays = array[2..50] of info; var A: arrays; begin A[1].name := 'name'; end. What is wrong with that? It gives me range check error and I have no idea what is that. ...

Pascal - bad number format

Program: program s; type info = record name, surname: string; min, sek: integer; end; type arrays = array[1..50] of info; var c, b: text; A: arrays; gr_sk, grup_dal: integer; begin assign(c, 'info.txt'); reset(c); read(c, gr_sk); read(c, grup_dal); id := ...

Problems compiling peazip on OSX

I'm having some problems with compiling Peazip on OSX (10.6). I emailed the Peazip developer and he said he probably couldn't help me too much as the error seems to be OSX specific and he doesn't have access to an OSX machine any more. The compiler I'm using is Lazarus as the source is in Pascal. The actual compile process seems to go ...

Delphi/Pascal training in high school/college/university

Are Delphi/Pascal being taught in any high schools/colleges/universities, particularly in Canada and the US? I was surprised how many schools in the UK are teaching Delphi. Their largest exam board is even dropping PHP/C#/C in 2011 and encouraging Delphi. I also remember that CodeGear was going to provide development tool licenses to ...

Are we Delphi, VCL or Pascal programmers?

In terms of naming: Are we Delphi, VCL or Pascal programmers? ...

Pascal's repeat... until vs. C's do... while

In C there is a do while loop and pascal's (almost) equivalent is the repeat until loop, but there is a small difference between the two, while both structures will iterate at least once and check whether they need to do the loop again only in the end, in pascal you write the condition that need to met to terminate the loop (REPEAT UNTIL...

What is the '#" symbol in Pascal?

For example: x := #123; I tried to search around Google but I simply have no idea what this means. ...

Lazarus: Can't find unit [unit] used by [program]

I'm trying to use an external library (wingraph) in a simple program. I have .o and .ppu files. I added the directory that contains them to the list of both "Other Unit Files" and "Include Files" paths under Project->Compiler Options. When building, I still get the error "Can't find unit wingraph used by [program]". The library is Windo...

How can I change standart input/output of another program?

I have a console application written in c++. It simply reads an integer from standard input(keyboard) and writes another integer to standard output(screen). Now I want to give some tests to that program and check its answers using another program. In another words, I want to write electron judge for that program. I want that program(whic...

Execute Assembly from Pascal

How can I execute this code from Pascal : MOV EAX, variable1 PUSH EBX, EAX MOV EAX, variable2 POP EBX AND EBX, EAX Where I define method/function arguments in function(variable1, variable2). This is a school assignment I don't know why they are making us do P...

call by value-result in Pascal

How can i simulate calling by value-result in this example. Without adding variables and without change a variable name.? Program one; var x:integer; Function two():integer; begin x:=x+1; two:=x; end; Procedure three(x:integer); begin x:=x+5; x:=two(); ...

how many braches can i create using if statement??

how many braches can i create using if statement?? is it limited?? ...

meaning of this statement?

In a Pascal program, what does statement s1:=[0,3,7] mean ? ...

keywords must be uset to create a variant record??

what keywords must be used to create a variant record?? ...

Getting started working with RemObjects Pascal Script in delphi

I have just started working with RemObjects Pascal Script. and have been trying to follow the remobjects tutorial. http://devcenter.remobjects.com/articles/?id={2FFC1EE9-F18D-4B11-9DE4-1BA0A79D0D04} all was going fine up to the part you run begin ShowNewMessage('Show This !'); end. where it claimed it does not know of it. but i ...

Fpgui and lcl and qt, what are the advantages and disadvantages?

Hi, Lazarus Ide can use several gui libraries. I am on Windows. I wonder what are difference among them... It is clear that lcl is most stable. Why would anyone use Qt and fpgui once they will be of good quality? ...

ObjectPascal identifier naming style on other languages

I learned to program with delphi, and i always liked the object pascal code style, looks very intuitive and clean. When you look at the variable declaration, you know what are you dealing with.. A fast summary: Exception E EMyError Classes and Types T TMyClass Fields in classes f fVisible Events On OnMouseDown Pointer types...

What does "free" do in Delphi?

I found the following code snippet here: with TClipper.Create do try AddPolygon(subject, ptSubject); AddPolygon(clip, ptClip); Execute(ctIntersection, solution); finally free; end Just curious, what does the free statement/function (between finally and end) do here? Google did not help. ...

Line intersection code in pascal

I'm trying to write line intersection code to detect if two lines intersect. the form i have stuff in is there are O objects that can have Lo(l subscript O) lines, each line has 2 points and each point has a x and a y. this is the record format. TPoint = record x,y:integer; end; TLine = record Point : array[0..1] of TPoint;...