2,552 questions
0
votes
1
answer
54
views
Which scope does the {$I-} directive have in Pascal?
I disable I/O checking inside a procedure:
procedure RewriteText(
FileName: string;
var TextFile: text;
var ErrMsg: string
);
begin
{$I-}
assign(TextFile, FileName);
rewrite(...
1
vote
0
answers
62
views
How can I add comments to tooltips with OmniPascal extension
I want to see comments as tooltips in VS Code with the OmniPascal extension. Right now, comments are not appearing in tooltips despite trying different Pascal commenting styles.
Maybe i just dont know ...
2
votes
2
answers
213
views
Keep Delphi In-line Assembly Labels in Assembly Blocks
Assembly is always faster than high-level languages. For example, I tested an empty loop in Delphi repeating 1 billion times, and same loop but written in assembly. The Delphi loop took 6 billion (x64 ...
-1
votes
1
answer
156
views
Convert Pascal real data type to C# type [duplicate]
I'm doing a proof of concept that involves porting some Pascal code over to C#.
The code involves financial calculations, so most of the fields are currency based (though not all).
All of the numeric ...
3
votes
1
answer
113
views
Why doesn’t rounding work outside of range?
Why does rounding not work if I try to compile following code using the FreePascal Compiler?
program RangeCheckError;
var
result: integer;
begin
result := round(1.6514384080961258e+21);
...
3
votes
0
answers
270
views
SAP GUI Scripting in Delphi
I am developing an application in Delphi that needs to interact with SAP GUI via Scripting to automate some material control operations. However, I am facing difficulties in establishing the correct ...
1
vote
0
answers
68
views
Access violation invoke Certificates_ICertificateQuery.get_Thumbprint
I try WinRT in Delphi. The following code encounter access violation when invoke get_Thumbprint:
program Sample;
uses
System.SysUtils,
System.Classes,
System.Win.WinRT,
System.NetEncoding,
...
0
votes
2
answers
76
views
SetAllPalette in Pascal
I have this function which does:
MyPalette : PaletteType;
MyPalette.Size:=16;
// sets some colors
SetAllPalette(MyPalette);
Reading the Turbo Pascal 5.0 manual it says:
Palette is an untyped ...
1
vote
1
answer
141
views
Why is the output 16 bits when I'm only telling it to write 15?
Hello everyone once again,
I need to write a code in Pascal which converts a decimal number into a binary number, and saves this into an array, and then writes it from MSD to LSD.
I've got most of the ...
0
votes
0
answers
439
views
How to read BIOS serial number? [duplicate]
In a PC running Windows, how could I read BIOS serial number and CPU serial number?
I use pascal, Delphi7.
The reason for this is that I want to identify a PC using something unique in order to ...
0
votes
1
answer
216
views
How to make a function that takes 2 dimensional array of Extended and return TArray<Extended>?
I have this function to solve 3x4 matrix by Gaussian elimination. But i got this error when running the program.
[Error] Unit1.pas(79): Identifier expected but 'ARRAY' found
[Error] Unit1.pas(79): ...
0
votes
1
answer
188
views
Why does my double-linked list display the numbers in reverse order, except for the first added number?
I wrote this code where you can add or remove numbers from a list, and then display the list. The problem is: it displays the numbers in reverse order, except for the first added number.
program ...
1
vote
2
answers
277
views
How to print emojis using Pascal on Windows cmd/powershell
According to this table the UTF8 code for the smiley emoji is: F0 9F 98 81.
I attempt to write this output to the console, to no avail:
Program emojii;
{$apptype CONSOLE}
Begin
WriteLn(#$F0#$9F#$...
1
vote
2
answers
160
views
Cascade recursion - max element in array
I'm trying to figure out how to write a cascade recursive function to find a max element in an integer array. I've tried to write some code but i think my function is more linear than cascade.
Here is ...
-4
votes
1
answer
172
views
Loading MP3 files into ListView. When multiple items are select, show <Multi>, need ability to save to each file even with <multi> showing [closed]
In this project, I'm opening MP3 files using the component 3delite.hu =- ID3v2 Library, and adding the MP3 files metadata to a ListView.
When you click on an item, its information appears in the Edit ...
1
vote
0
answers
83
views
No debugger via text IDE (Go32v2)
I just installed Free Pascal v3.2.2 (within dosbox-x). Unfortunately debugging from the (go32v2) IDE doesn't work. Whatever I do, it says "no debugger support available".
Update: It seems ...
2
votes
1
answer
260
views
In Delphi, is it a correct approach to Free the Sender within an Event?
So, say we have a class like this:
TFieldsReadyEvent = procedure(Sender: TObject; Code, AuthorizatedID: string) of object;
TCatcherServer = class(TServer)
private
FOnFieldsReady: ...
-2
votes
1
answer
155
views
Why is this code used to draw a raycast vector not displaying the vector correctly?
Following the examples given in the Pascal-driven Castle Game Engine for drawing a mesh, I tried to draw a raycast vector visually using this particular piece of code for reference:
procedure ...
0
votes
1
answer
185
views
How to handle libnodave error message with Delphi?
I have a function that reads some values from Siemens PLC using libnodave.dll and nodave unit but I cannot figure out the error output. I am on purpose forcing to go in error and what I get from ...
0
votes
0
answers
100
views
How to get the names of the MIDI devices to the comboBox?
With the following code in Lazarus, I can check out how many MIDI devices there are available on my PC and put the ID numbers to the combo box:
var MyMIDIDevice : integer;
begin
cmbMIDIdevs....
0
votes
0
answers
276
views
Delphi Android service was stopped after closing the android application
I have used Delphi 12 for developing Android application and I'm trying to Service which needs to runs in the background to receive the frequent messages from Server using TCP sockets to displays the ...
0
votes
1
answer
273
views
How to assign to an array in Pascal?
I'm getting an error I don't understand. I am trying to just assign a value to an element of an array in pascal.
function TestingThing() : Integer;
type
IntegerArray = array[0..$effffff] of Integer;...
2
votes
1
answer
121
views
what does this illegal expression mean in pascal? [closed]
this is the code and I get these two errors 1: 8,14 illegal expression and 2: 8,1 ''warning: variable k does not seem to be initialized
program komunaluri_1;
var
den, g, w, das, k : integer;
begin
...
0
votes
1
answer
131
views
gotoxy command got skipped in pascal
I'm working on a school assignment. In line 87 and down, the gotoxy didn't work but the code does. Here's the cropped part of the code.
gotoxy(32,24); write(' ...
1
vote
2
answers
525
views
Fast Report in Delphi 11. How to print each record based on the Quantity field of the record
I have a master Detail report.
I want the report to print the master information (With its details) based on its quantity field.
So if the Quanitty field of master record is 3 it should show up 3 ...