Most voted "pascal" questions
Pascal is a structured programming language, named after the mathematician Blaise Pascal.
Learn more…67 questions
Sort by count of
-
6
votes1
answer624
viewsRemove all leaves from a binary pascal tree
I’m trying to implement an algorithm that removes all leaves from a binary tree, that is, we don’t have any children. I can remove but I can’t leave the "parents" of these nodes with zero reference.…
-
5
votes2
answers681
viewsDownload during installation by Inno Setup
I work with a company that uses Inno Setup to create the installers of its products, recently I was tasked with creating a better installer, one of the improvements that were suggested would be to…
-
4
votes1
answer4167
viewsDefining an array vector
I’m learning Pascal and I’m having basic syntax problems to define a vector type variable. Here is the statement: var x:array[0..225] of String; I would like to assign the following values and in…
-
4
votes3
answers648
viewsHow to include functions or procedures in Pascal through an existing archive?
I’m new to Pascal and I’m looking for how to call functions or procedures from an existing archive in Pascal. There is a function in Julia called include('filename.jl') where I add functions already…
-
4
votes0
answers284
viewsInno-Setup: Uninstall without admin permission
Using Inno Setup, need that when a program is installed on the machine, by a user administrator, can be uninstalled by a default user. The parameter Privilegesrequired is as lowland, but the problem…
-
4
votes1
answer216
viewsProblem with the sum of 10 numbers with for
I have a doubt in an algorithm that sums 10 numbers with the repetition command for. soma_numero := soma_numero + idade; When I declare the soma_numero as 0 before the for the algorithm runs…
-
4
votes1
answer180
viewsWhy does Floattostr exist if Delphi does not possess the Float data type?
Reading about the data types of Delphi/Pascal I realized that there is no type Float, however, there is the function FloatToStr(), as well as StrToFloat(). In this case, you could use floating point…
-
3
votes1
answer150
viewsDoubts with generation of random values
I have a question about a college job that I have been doing. It consists of creating a naval battle game, in PASCAL. I’m using the contents of this link as a guide to write the program:…
-
3
votes1
answer597
viewsLazarus IDE: Importing images into the project
Lately I migrated from Delphi XE6 to Lazarus IDE, and as I am not used to the new platform I would like to know how I can import images, videos and other features in the project and use them…
-
3
votes3
answers766
viewsHow to convert a String to Tnotifyevent in Delphi?
I want to change the Ontimer event from a Ttimer in my project at runtime, I tried as follows: Timer1.OnTimer:= ('close'); But Delphi reports this: (E2010 Incompatible types: 'TNotifyEvent' and…
-
3
votes2
answers599
viewsSpecial characters in excel spreadsheet generated in Delphi
I found on the internet many codes related to generating EXCEL spreadsheets in DELPHI. Follow the code I am using: objExcel := CreateOleObject('Excel.Application'); objExcel.Visible := True;…
-
3
votes1
answer1080
viewsHow to remove all references from deleted acestras forms from the parent form?
I have my generic form and I have several others who have visually inherited its components. When I delete a component in the form father and open a heir get that message: I can click OK and confirm…
-
2
votes1
answer1024
viewsCreating Tedit in Real-Time and Onenter Action
Lately I’m developing a mobile app and need to create a TEdit in real time with the predefined action function. So far I can create, but without the function OnEnter action. Here is the code:…
-
2
votes1
answer875
viewsHow to implement the Dijkstra algorithm in Pascal?
I’m trying to implement Dijkstra’s algorithm, creating a Pascal function. I have something like: function Dijkstra(L:mapa):integer; begin min := max ; map.mini:= 0; for i := 2 to min do if…
-
2
votes1
answer337
viewsHow to create a Virtual String Tree in Delphi
What happens is that I created a Virtual String Tree in Delphi (Typhon64), but I don’t know how to add parent and child nodes to create the tree, I looked at the documentation but only found click…
-
2
votes2
answers923
viewsGenerate Code text file done in Pascal
I have a code in Pascal. Here’s the thing: Program Pzim ; var i:integer; vect:array[1..1001] of integer; Begin i:=1; for i:= 1 to 999 do vect[i]:=i+1; for i:= 1 to 999 do writeln (vect[i]); readln;…
-
2
votes1
answer150
viewsUsing data from an array in a Report
I have a matrix like this that is being filled in Runtime: MatSort[0][0] - Nome1 MatSort[0][1] - InfoNome1 MatSort[1][0] - Nome2 MatSort[1][1] - InfoNome2 But I don’t know how to reference the data…
-
2
votes0
answers42
viewsCheck if program has been compiled for 32 or 64 bits
Good afternoon, I am setting up my fpc here for cross-Pilation and would like to make sure that it is working properly, I want to do a test program and compile on each platform, soon after checking…
-
2
votes1
answer61
viewsProcedure runs alone -Pascal
I made a code in pascal that reads two images type pgm and checks if one is contained in the other, but when reading the second image, instead of reading the program simply warns that the type of…
-
2
votes0
answers164
viewsHow to transfer a file(db) from Android to PC using Delphi(Firemonkey)
I am using Delphi Tokyo 10.2.3 for Android programming, Firemonkey deputy (FMX), I need to create a code that is possible inside the App on android can transfer a file in case the Database to the PC…
-
1
votes3
answers720
viewsHow to find values in pascal
I’m setting up a program here at Pascal, where I have a record with 3 positions, each with name, age and weight. I also have a procedure called query, which will allow me to search for a registered…
-
1
votes2
answers690
viewsAvoiding two processes of the same application in Pascal
What is the most viable way to identify the processes of my application in memory and close them if there is more than one execution. I use the Lazarus IDE platform (looks like Delphi), which…
-
1
votes1
answer203
viewsI cannot change a record in a Pascal . dat file
I’m doing an exercise for school and I can’t get the program to rent and return cars. Whenever I try to do this the program breaks (crash) and I don’t understand why. Follows code: Program cargest;…
-
1
votes1
answer895
viewsLazarus accents in JSON
I’m having a problem with accentuation in Lazarus, when I get a JSON coming from a URL it returns characters like " u00ed" instead of "í", someone knows what I can do? Follows the code procedure…
-
1
votes1
answer901
viewsFunction for popular Ttreeview only adds Childs to the first Node
I created this procedure to popular a treeview: procedure TFrmGerProfDock.Button1Click(Sender: TObject); Var Tables: TTreeNode; I: Integer; begin for I := 0 to ds.DataSet.FieldCount - 1 do begin…
-
1
votes0
answers192
viewsCreate SQL Tax Table
I am developing a system for budgets and, to finalize my project, I need to create a tax table. To help, follow an example of what I want to do: in the raw material table, each material has a…
-
1
votes1
answer737
viewsHow to check the INEXISTENCE of a directory on an FTP server in Delphi?
Use the Delphi and the Lazarus to create my applications, what should I do to check the non-existence of a directory contained in a FTP server? For example, when will you check the non-existence of…
-
1
votes2
answers229
viewsAdd to Text File Using pascal
I did this algorithm on Pascal that feeds numerical information into a text file. program Pascal; var i:integer; Vect:array[1..1001] of integer; Myfile: text; begin i:=1; for i:=1 to 999 do…
-
1
votes1
answer732
viewsProblem defining onClick in Runtime with Pascal (Delphi/Lazarus)
I need to use the procedure ClicaItem(Sender: TObject); in a OnClick created at runtime by the procedure CriaItem(nome:String);. However, in all my attempts, I could not attribute item.OnClick à…
-
1
votes1
answer101
viewsAbout passing parameters in compiled programming languages
What would be more advantageous when calling a function, putting in the stack from right to left or vice versa? And cleaning the stack? The function that calls (Caller) or what is called (calee)…
-
1
votes2
answers1306
viewsHow to use exponent in Pascal?
I have a problem to solve, where the PG formula uses exponent other than two (squared), and cannot use sqrt(). How can I resolve this in Pascal in an intuitive way? I know you can’t use it ** also.…
-
1
votes1
answer418
viewsFrame Replication [Error: Component already exists]
I have a form in Delphi and I wanted to have a pre-created frame added dynamically several times by clicking a button. I’m trying through this code: procedure TMain.Button1Click(Sender: TObject);…
-
1
votes0
answers163
viewsHow Can I Record an Audio with Android API Audiorecorder In Delphi Pascal
I have a small project where I need to record an audio by the android API through Delphi with Pascal, but I haven’t had much success in my codes. Could someone help me in this dilemma? what I have…
-
1
votes1
answer800
viewsCombobox in firemonkey without using Fdquery
I have a states combobox in my register, where I connect via livebindings with an Fdmemtable to save the data in the database. How could I get the index item of the selected item in the combo? The…
-
1
votes4
answers115
viewsAlgorithm execution error in pascal
I’m studying the use of CASE in the Pascal language, but when I run it appears syntactic error ";" não esperado, in this algorithm: Program Crianca_Esperanca ; var D: integer; valor: real; Begin…
pascalasked 5 years, 8 months ago Glaucio Pontes 25 -
1
votes1
answer131
viewsSimulate keystroke - Delphi
Hello, I’m having trouble sending the keystroke in a game, I’m using Delphi, I tested functions like: SendMessage(hdle_do_game, WM_KEYDOWN , ord('a'), 0); keybd_event(65,0,0,0);…
-
1
votes2
answers66
viewsType number again if repeated
It is necessary to make a program in which the user type 5 numbers. If one of these numbers is repeated, he must ask the user to type another number again, but any number I type appears which is…
pascalasked 4 years, 6 months ago user162817 71 -
1
votes0
answers60
viewsAdding Records with Specific Data
Well, I’m currently working on a project that we use Clientdataset’s to communicate with the database. My problem is Next, I have a Receiving Report in the Export Sector, in which there are several…
-
1
votes1
answer16
viewsHow to hide decimals in pascal?
I’m making a currency converter and I’m having trouble with the decimals, for example: "$1.0 equals R$ 0.18248175182481752" I would like to know how to hide the decimals from the second house. The…
-
0
votes1
answer884
viewsIdentifying a String as Pascal variable name
I have 50 variable array type and I have a method that will receive a String containing a name of an existing variable. I would like to know what is the ideal way to identify the value of the…
-
0
votes1
answer286
viewsHow to create a Canvas object in Lazarus and add it to a Paintbox?
In a Form have a Paintbox property Align = alClient and a Button. I need to draw an object of the type Canvas within the Paintbox at the event Onclick of Button. This is the object of type Canvas…
-
0
votes2
answers2827
viewsHow to know if there is a line selected in Dbgrid?
How can I know if there is a selected line in my Dbgrid. In this case below: The pointer is selected in the dataset, but I wanted to know when the grid is this way: In this case it would be only if…
-
0
votes1
answer53
viewsEclipsegavab: error when compiling file. pas
I installed Freepascal 32bits and installed the 32bit Eclipse Gavab But you’re making a mistake! Any suggestions ?…
-
0
votes0
answers138
viewsColouring in pascal/C
I have the following coloring code of regions using queue in Pascal: program coloracao; uses crt, filas; const dim = 5; type imagem = array [0...dim+1, 0...dim+1] of integer; const I: imagem = ((-1,…
-
0
votes1
answer81
viewsReceive character in C
How do I do a function in C equal to the function Readkey of Pascal or equal to the function Lastkey of the old man Clipper? I want to receive only one character separately for each key pressed.…
-
0
votes0
answers246
viewsHow to exclude elements from a registry vector in Pascal
I’m doing a work for the course, and every time a person typed a value from an index of the record vector element, all the data from it was erased, would that be possible? If so, how do I?
-
0
votes2
answers162
viewsLazarus Comparing Dates
In the data collector I can configure the format of Data, but I want to make this configuration within my application, I am trying to do as follows: FormatSettings.ShortDateFormat := 'dd-mm-yy';…
-
0
votes1
answer453
viewsReturn number of rows or columns of an array
I have a matrix like this in Delphi XE8: Matriz[2][3]. I wonder which method can I use to return the number of rows or columns in this matrix, my idea is to loop with 2 for's and traverse the matrix…
-
0
votes1
answer495
viewsFast Reports tools do not appear in the Palette tool
I am using Delphi-XE8 in a project that requires the creation of forms from DB data (Firedac), before my team used the version of Delphi-XE4, which made use of the external component Rave Reports of…
-
0
votes2
answers1343
viewsHow to eliminate repeated numbers from a visualg vector?
algoritmo "semnome" // Função : // Autor : // Data : 06/02/2018 // Seção de Declarações var veto1 : vetor[0..9] de inteiro veto2 : vetor[0..9] de inteiro j,i : inteiro inicio para i de 0 ate 9 faca…