I'm working in Pascal, I don't understand why I'm getting a NZEC error when I'm submitting my problem. On my pc it works perfectly. Can you give my your opinion please?
program super_factor_sum;
var k,i,j,s:longint; f,g:text;
function prim(x:integer):boolean; var d:longint;
begin
prim:=true;
for d:=2 to x div 2 do if x mod d=0 then p...
Q1: What does this mean: WriteLn (#$0b)?
$0b should hexadecimal like 0x0b, but what about the # sign?
Q2:
x:=readkey;
if ( x = #5) do...
Does #5 mean five? Then what is the# sign for?
Many thanks.
...
Hey,Guys I'm having trouble displaying names using arrays in my Pascal program.
But first heres the question I'm writing the program to answer :
And here's what I've done so far(It's a bit messy):
...
Hello, I have this Lazarus program:
unit Unit2;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, ComCtrls;
type
{ TForm2 }
TForm2 = class(TForm)
procedure OnTlacitkoClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction:...
Is anyone aware of a Pascal interpreter/compiler which is embeddable in C++ (or anything else other than Pascal) applications? I am cloning (for lack of a better word) an application which uses an Object-Pascal compatible scripting language and needs to be script compatible. Am I going to end up writing an interpreter? (!)
...
I haven't been able to find the answers to a couple of my Delphi memory management questions. I could test different scenarios (which I did to find out what breaks the FreeAndNil method), but its takes too long and its hard! But seriously, I would also like to know how you all (Delphi developers) handle these memory management issues.
M...
This is the code section from inno setup.My intention is to make two Checkbox where at a time one is being selected.
But this code return error.
[code] section:
procedure CheckBoxOnClick(Sender: TObject);
var
Box2,CheckBox: TNewCheckBox;
begin
if CheckBox.Checked then
CheckBox.State := cbUnchecked;
Box2.State := cbChecked;
else ...
I am a student, and I'm working on a little slots game (if the same random number comes up 3 timed, you win). I use Borland Pascal 7. I use graph to make this a bit more visual, but when I start the game my background turns from black to grey, and the other problem is that if I click the game start button, the game runs many times until ...
Hi! I use Borland Pascal 7.0, and I would like to make a slots game (If 3 random numbers are the same, you win). The problem is that when I click on the start (Inditas) button on the menu, the procedure executes many times until I release the mouse button. I was told that I should check if the mouse button is released before executing th...
I am relatively new to world of programming. I have a few performance questions:
Do console apps run faster than apps with a graphical user interface?
Are languages like C and Pascal faster than object oriented languages like C++ and Delphi? I know language speed depends more on compiler than on language itself, but do compilers for pr...
After a lot of experimentations, I found a way to exchange PChar from a FreePascal compiled DLL with a Delphi compiled EXE. I'm in charge of both the DLL and EXE source code but one MUST BE in FreePascal and the other one in Delphi. My solution involves the following methods in the DLL:
function GetAString(): PChar;
var aString: string;...
Hello, what's the better way of parsing date in Pascal than manually parsing character after character?
Date should be in mm.dd.yyyy format.
...
I'm starting to play around with PPCompiler, that is a onboard Pascal compiler for Palm OS, but I want to know where could I get some reference to build GUI applications, with textboxes and these things.
Reference = Like those help files with many resources and examples
...
Hi! Could you please help me to figure out how to bring Opera's window to front, using class name?! I use the following procedure to bring other applications to front and it works fine. I need to use only a class name and not window's caption. If I use window caption instead, the procedure works. Here is the procedure:
procedure Switch...
Hi!
I have a Player class in a separate unit as follows:
TPlayer = class
private
...
FWorld: TWorld;
...
public
...
end;
I also have a World class in a separate unit as follows:
TWorld = class
private
...
FPlayer: TPlayer;
...
public
...
end;
I have done it this way so that the Player can get data from the world vi...
In Standard Pascal what are considered simple types? Are these the only types that can be returned from a function?
...
I'm trying to use some windows command line tools from within a short Pascal program. To make it easier, I'm writing a function called DoShell which takes a command line string as an argument and returns a record type called ShellResult, with one field for the process's exitcode and one field for the process's output text.
I'm having m...
I'm looking for tutorials and examples on Pascal FC's channels and rendesvouz mechanisms.
...
Program Parcial2;
type buffer = channel of integer;
var buffers : array [1..2] of buffer;
val:integer;
process sleeper (id:integer);
var i : integer;
begin
for i:=1 to 10 do
begin
sleep (random(10*id));
**buffers (id):any;**
end;
end;
process troll;
begin
buffers[1]: random(10);
end;
process watcher;
begin...
Hi,
I have this task and i can't figure out how to do it.
I need to find persons age in days, there are given birth and death dates, there's data file:
8
Albertas Einšteinas 1879 03 14 1955 04 18
Balys Sruoga 1896 02 02 1947 10 16
Antanas Vienuolis 1882 04 07 1957 08 17
Ernestas Rezerfordas 187...