2,596
questions
0
votes
0
answers
187
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 ...
-4
votes
1
answer
133
views
Kyan Pascal: compiler error "Too many indices on the closing bracket of a[t]" [closed]
In Kyan Pascal for the Commodore 64, I keep getting the error:
Too many indices on the closing bracket of a[t]
...in the first line of my first procedure:
For t := 1 to 100 do a[t] := t;
Whole ...
0
votes
1
answer
182
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): ...
-1
votes
2
answers
165
views
Instead throwing BSOD nothing happend after clicking button
I tried to write program which throws BSOD after clicking a button in Delphi:
procedure RtlAdjustPrivilege(var Privilege: Integer; var bEnablePrivilege: Boolean; var IsThreadPrivilege: Boolean; var ...
0
votes
1
answer
135
views
How can I save an INTACustomDockableForm window position in Delphi layout
The INTACustomDockableForm interface includes two methods: one for saving the window state and another for loading it.
I have implemented them as follows:
...
procedure TMyDockableForm.SaveWindowState(...
0
votes
1
answer
151
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 ...
2
votes
1
answer
90
views
Standard Pascal 7185 silent on reading strings from textfiles
In the ISO/IEC 7185:1990(E) Standard Pascal specification, in Clause 6.9.1 for the procedure read, subsection "a)" reads as follows:
a) For n>=1, read(f,v1,...,vn) shall access the ...
1
vote
2
answers
154
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#$...
0
votes
1
answer
151
views
write a code that divides a number into several different intervals and performs special calculations for each interval
I want to write a code that divides a number into several different intervals and performs special calculations for each interval as follows.
At the end, show the sum of all the obtained numbers. I ...
1
vote
2
answers
98
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 ...
0
votes
1
answer
85
views
I search a unit to solve the turbo pascal 255 string limit
is there a framework/unit that I can fill with strings to solve the 255 string limit?
Example with a loop
MyStringAllwaysWithOneString := 'X';
for i := 0 to CompleteStringLength do
begin
...
-4
votes
1
answer
142
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, we are opening MP3 files using the component 3delite.hu =- ID3v2 Library, and adding the MP3 files metadata to a ListView.
What I would like to accomplish.
When selecting multiple ...
0
votes
0
answers
111
views
anonymous thread with parameter in lazarus
i cant pass parameter withe the anonimous tread in lazarus
i used a delphi examples but they dosn't work
procedure hi(i:integer);
begin
form1.caption:=inttostr(i);
end;
procedure TForm1....
0
votes
1
answer
136
views
Plotting a polar rose — how to use "n" and "d" to achieve different shapes?
In code form, the calculation of the coordinates of the polar rose point in the Cartesian system can be represented as follows:
X := OriginX + A * Cos(K * Theta) * Cos(Theta);
Y := OriginY + A * Cos(K ...
1
vote
0
answers
61
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 ...
1
vote
1
answer
172
views
Is there a way to initialize all items in a 2D array in Pascal on one line (without looping)?
I know that instead of doing the following for a 1D array of Integer, arr,
SetLength(arr, 4);
arr[0] := 11;
arr[1] := 12;
arr[2] := 13;
arr[3] := 13;`
I can also do the above just on one line:
arr := ...
2
votes
1
answer
214
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
0
answers
301
views
How to Implement a Checksum Algorithm Based on a Written Description
I'm working on a project that is asking me to treat data coming from satellites and some frames are ended by a checksum. The ICD lists the checksum as being a "Binary 16-bit sum of data words (2 ...
-1
votes
1
answer
127
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 ...
1
vote
2
answers
102
views
How do I properly assign integers in an array?
Im currently trying to make a binary insert program, it reads a random number and inserts it in a sorted list, but every time I execute the program it just returns a list full of 0's I had this ...
0
votes
1
answer
105
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
1
answer
136
views
How to find if a valid JSON string
Hello guys Is there a way to know if a string is a valid JSON type string in lazarus.
I have been using GetJSON(testString) but throws an error if string is not JSON type.
Thanks
0
votes
0
answers
71
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
1
answer
122
views
How can I identify the mistake in my Pascal Code?
Here's the code, I don't think that there's a mistake in Read1d Procedure but each time I execute this program it displays that the value of all the elements of the array is 0. Where is my mistake?
...
0
votes
0
answers
211
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 ...
1
vote
1
answer
413
views
Getting error while trying to build Android application using Delphi 12
I have installed Delphi 12.0 and tried to build an Android 64-bit application and I'm getting an error that
Can not execute the Java.exe.
Currently, I'm using Jdk1.8 and do I need to use any ...
0
votes
0
answers
54
views
Inno Setup program Im getting a run error using 6.2.2 Access Violation
In this code I'm getting Run time error Exception Access Violation at address 00901E9C Execution of address 00901E9C when it hit objNodes.item(0).setAttribute(xAttrib, xAttribSetValue); Any help ...
2
votes
1
answer
310
views
Is there any way to enhance syntax highlighting in RAD Studio code editor?
Even if I think the title asks the question by itself, I'd like to show an example of what I'm talking about. When working with other languages, I see this:
Python in VSCode:
And working with Delphi'...
0
votes
1
answer
184
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;...
0
votes
1
answer
68
views
Pascal - Shape Drawing
So the task is to draw this shape :
******
** **
* *
** **
******
The number of rows is set by the user,and it is labeled as n.In this case it is n=3.
So i tried splitting it in two , and i ...
0
votes
0
answers
48
views
How do I check if the install mode is admin or not and use that information for adding registry keys at different locations (Inno setup)? [duplicate]
I am an extreme beginner in Inno Setup (Pascal scripting). I am on Windows and using Inno Setup and I am trying to edit a registry value (environment variable PATH) so that the user can start my ...
1
vote
1
answer
80
views
what does this illegal expression mean in pascal?
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
...
2
votes
1
answer
90
views
Reset Input back to console window?
Is there any way in Free Pascal/Delphi to reset the standard Input file back to console window after it was assigned to a 'real file' temporarily?
AssignFile(Input, 'stdin.txt');
...
...
0
votes
1
answer
99
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(' ...
0
votes
1
answer
131
views
Can I save a Dictionary of interfaces or the inherited classes and then call Create on the sub-classes from that dictionary?
What I want to do is have a dictionary of different class types that all implement an interface or have a shared parent class. Using this list, I want to instantiate the correct one from a string ...
0
votes
2
answers
319
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 ...
-2
votes
3
answers
267
views
Illegal Expression on Pascal
program latihan;
uses crt;
var
a, b, c : integer;
d : real;
begin
write('a: ');
readln(a);
write('b: ');
readln(b);
c := a + b;
d := a + b;
sqr(c);
writeln(c);...
0
votes
1
answer
112
views
Condition as sum of hexadecimal numbers in old Pascal code
I've got a very old Pascal program. At the top of the unit is a set of constants looking like:
feature1 = $01;
feature2 = $02;
feature3 = $04;
feature4 = $08;
feature5 = $10;
In database there is ...
0
votes
0
answers
81
views
The color of my label is not changing even though I changed it in my code
I was trying to change the color of my label. The code does not show any error, but it does not seem to work either.
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, ...
0
votes
1
answer
210
views
Given a word or set of characters how to only take one part and dispose the rest
I use Free Pascal where I have to do a task for college course (introduction course to programming).
We are not allowed to use certain words from Free Pascal like string, break, and some other ones ...
1
vote
1
answer
258
views
How can I create a TBitSet32 record in Delphi for efficient 32-bit operations?
I am working on a project where I need to manipulate a set of 32 bits very efficiently. Memory efficiency is crucial, so using an array of boolean (which would occupy 32 bytes) is not an option (if I ...
0
votes
2
answers
135
views
I have used so many "if" and I would like to know if I can substitute some by "case"
I have this code:
program Coordenadas;
var
x,z : integer;
begin
writeln('Ingresa la coordenada en X.');
readln(x);
writeln('Ingresa la coordenada en Z.');
readln(z);
if (x=0) and (z=0) ...
0
votes
1
answer
166
views
Is there a Delphi equivalent for GCC's __builtin_popcountl, __builtin_clz, and __builtin_ctz?
I'm currently translating some C++ code into Delphi and came across the following GCC built-in functions:
__builtin_popcountl(x): Counts the number of set bits (1s) in the integer x.
__builtin_clz(x):...
0
votes
0
answers
69
views
I cannot use the Format function in Apophysis 7x
I am playing with a drawing software called Apophysis 7x 15D 32dit and I am having trouble writing code from Script and it throws an error. The error text pointed me to the wrong type of Format ...
0
votes
1
answer
451
views
FireDac FDQuery Access Violation when called multiple times
I have a strange error whereby FDQuery throws access violations when called multiple times in my function. Basically, I have a function which loops through a date range to produce a 2d array of data ...
0
votes
1
answer
413
views
Inno Setup : How to setup advance settings for IIS application pool?
In Inno setup script how to set advance settings for IIS application pool? I'm specifically looking for setting Idle Time-out property?
I was not able to find and helpful information related to ...
0
votes
1
answer
533
views
How to use relative file paths in Lazarus
I'm creating a simple CRM in Lazarus with an SQLite backend but I can't figure out how to give Lazarus the file path to the database file relativly. This is needed for when I publish the app as I won'...
1
vote
1
answer
96
views
Why "BlockRead" can use a buffer whose size is smaller than the size of the data being read
I have a program:
program OverflowTest;
var
src: file;
dest: file;
res: longint;
buf: byte;
begin
assign(src, '48_bytes_file.txt');
assign(dest, 'copy_of_48_bytes_file.txt');
...
0
votes
2
answers
179
views
Why my exe is looking for version.dll locally?
I have an issue with the executable I generate in Lazarus ( I have the same problem with any project in the example folder found in Lazarus installation folder) and the windows dll version.dll. I know ...
0
votes
0
answers
230
views
Delphi VCL code found a strange problem in Win11, set the pixel format to 8bit (index format), there was a display problem
Delphi VCL code found a strange problem in Win11, set the pixel format to 8bit (index format), there was a display problem, the code is:
Image1.Picture.Bitmap.PixelFormat:=pf8bit;
The displayed effect ...