Posts by Tiago Rodrigues • 849 points
41 posts
-
0
votes1
answer52
viewsA: Subclass array of a superclass in Delphi XE7
You have to declare types for arrays in order to cast. Something like MyParentClass = class end; MyChildClass = class(MyParentClass) end; TArrayOFMyParentClass = array of MyParentClass;…
-
1
votes1
answer92
viewsA: What is the difference between passing nil in Synchronize/What is the difference between a Task/Thread?
This is not where the code will be executed, but what thread it will sync to. In case of passing nil will be with the Main Thread (there is only one) the Tthread.Currentthread represents the current…
-
3
votes1
answer66
viewsA: Bde package reference error in Delphi
In the portal of Embarcadero, in your account, where it shows the available downloads, there is the BDE Installer for RAD Studio. BDE has been discontinued and does not come with Studio from…
-
2
votes1
answer467
viewsA: Doubt - Creation and completion of Threads in Delphi
Some notes: You should pass the form in Create of the thread instead of 'plunge' the id. On top of that you do . Start(); before you give it the idPrivForm. With some bad luck, you have errors in…
delphianswered Tiago Rodrigues 849 -
1
votes2
answers56
viewsA: Uncheck Checkbox With Password Only
I think you’re doing the wrong IF for the combo. When you have the combo checked and click on it, it enters this method already with checked=false and not checked=true. So your code works by…
-
4
votes2
answers70
viewsA: Inputado value does not appear
You are using the Size property.... which does not tell you anything about what was typed. Need to use the if StrToInt(edtN1.Text)> StrToInt(edtN2.Text) then
-
2
votes2
answers76
viewsA: How to extract the attribute from within A HREF with Delphi?
On the one hand you can use Pos, Leftstr and Rightstr to cut the string and extract the info you want. On the other, more versatile, you can use Regular Expressions to extract what you need. I did a…
delphianswered Tiago Rodrigues 849 -
0
votes3
answers623
viewsA: Wait Thread Finish to continue code - Delphi
You could also call a method to deal with the end of the load there before the form.release, within the syncronize zone. It turned out to be a callback notifying the end of the thread and even more…
-
2
votes1
answer134
viewsA: Check if I have data in the query, when giving the next or prior
To know if it is the first or last record is to use the functions dataset.bof (Begin Of File, file start) and dataset.eof (End Of File, end of file) So typically the loop of a dataset is like this:…
-
0
votes1
answer56
viewsA: FMX and Styles - Put a unique Style for the whole project
I think the only alternative is to put the Stylebook in a Datamodule and share with all Forms.
-
0
votes1
answer379
viewsA: Error filling Listview in a thread (Delphi)
You should not manipulate visual objects within a thread, let alone in mobile. Any part that involves a visual component must be inside the Synchronize or a Queue, to be guaranteed to run in the…
-
1
votes2
answers195
viewsA: Delphi Seattle Problems with Sockets
I don’t know if it’s at all but in Tokyo the only Unit I have with this class is Web.Win.Sockets It’s not in the default project (I may not have installed something with the IDE) but it’s in the…
-
0
votes5
answers1444
viewsA: Query pass null parameter
If you go with Firedac’s Querys you can, using macros instead of params In query uses select * from tb_teste where tb_teste.data_hora !PARAMETRO; and in the code Query.MacroByName('PARAMETRO').value…
-
0
votes3
answers923
viewsA: Focus item on Listbox with Delphi
For what you want, you may only lack the use of the Leftstr function. Something like: uses strutils; procedure TForm1.Edit1Change(Sender: TObject); var i: integer; txtLen:integer; begin //Guardar…
delphianswered Tiago Rodrigues 849 -
2
votes1
answer65
viewsA: Windows Features With DELPHI
You can create an installer for your application, for example, with Inno Setup. http://www.jrsoftware.org/isinfo.php…
-
3
votes2
answers688
viewsA: Delete a line in Dbgrid without deleting in Database
You can use the qryAuditionsInitial Filter field to hide records you don’t want to show the user Something like qryAudienciasInicial.Filter:='(ID<>5) AND (ID<>6)';…
-
3
votes1
answer989
viewsA: How to call an inherited form precedent through the standard form?
I don’t know how you’re doing setting these events, but an easy solution would be to take the code out of the buttons and put it in your way. In the standard form procedure DoSave; virtual; with the…
delphianswered Tiago Rodrigues 849 -
0
votes1
answer82
viewsA: Treeview Delphi with BD link
The only thing I see missing in your code is that to use Findclass you need to call Registerclass first. I would say you have to initially call Registerclass for all classes of Forms you want to…
-
2
votes2
answers732
viewsA: I opened a Form inside a Panel
Yes you can. Just indicate that your Form’s Parent is the panel you want. Something like //Criar nova instancia do form e mostrar num painel f:=TFrmMeuForm.Create(); f.BorderStyle:=bsNone;…
-
1
votes1
answer144
viewsA: Unix Time for Tdatetime
To create a date from Stamp (which I suppose to be in seconds) I could only do dt:=incSecond(0,750382); using a dt variable of the Tdatetime type and the Incsecond function (Unit Dateutils) However,…
-
2
votes2
answers206
viewsA: Set Actionlist Enabled Property to True
The problem is that Voce has the name of the action but cannot directly convert it to a Taction type Object. Assuming your Actions are inside a Tactionlist (correct me if I’m wrong), you can make a…
-
0
votes1
answer282
viewsA: How to pass an array to a property?
It seems a problem similar to this Delphi _How to pass data to a record array type property You may also have to declare a type for this array. Sometimes you cannot use the array of [something]…
-
0
votes1
answer975
viewsA: Delphi _How to pass data to a record array type property
I think you made the mistake of putting the Tarrayofrateio type of power instead of Trecordrateio. If you change to property Rateio[AIndex : Integer] : TRecordRateio read GetRateio Write SetRateio;…
-
1
votes1
answer286
viewsA: Run a precedent while the component is pressed
Instead of moving in the event Mousedown, You can have a timer (or other similar process) to make the move. This timer is activated on Mousedown and disabled in Mouseup. So the user presses the key,…
-
0
votes3
answers1190
viewsA: Problems with Midaslib
But is it on your computer or a client computer? What you usually do is you have to put the uses midas, midaslib, in the project code (file .dpr of your project). You can get there by clicking on…
-
1
votes3
answers69
viewsA: How to read only Formatdatatime numbers
Using Unit Dateutils, you have access to functions such as Hourof(Tdatetime). You can do valorHora:=HourOf(now); and use this value as an int
-
0
votes1
answer38
viewsA: Calling Createparams from an inherited component
I think this is your problem https://stackoverflow.com/questions/14734419/changing-createparams-dynamically I will not put the code that is already there in the link but basically is to use…
delphianswered Tiago Rodrigues 849 -
0
votes1
answer87
viewsA: How to work with type Enerico
The Margins property comes from Tcontrol, so you can change its function to receive a Tcontrol instead of a Trectangle. procedure EditRectangleMargin(rtObjeto : TControl... Since Tlayout, Tlabel,…
-
1
votes2
answers749
viewsA: Delphi - how to treat delete in the master-Detail relationship?
In addition to the possibility already described above you can also do 'manually', through the event Beforedelete of Tfdtable master and place the confirmation message and a loop to erase the lines…
-
0
votes1
answer276
viewsA: Datasnap with Firedac
You need to change the Tuclasseservidorclient class to accept a Tfdconnection in Create. They are very different components and there is no direct correspondence between the class Tdbxconnection and…
-
0
votes1
answer1110
viewsA: How do I adjust the size of items in a Tlistview
To break the additional products you can replace the comma with a Chr(13), for example. I don’t know if the text is created by you or not, but if it’s not, you can use a…
-
2
votes1
answer150
viewsA: Using data from an array in a Report
You can inject this data into the report . But it’s easier and convenient in the report to work with datasets. Why not fill in a Tclientdataset (A memory dataset that doesn’t need to be connected to…
-
0
votes2
answers1157
viewsA: Problem opening form inside panel
If you use a Frame instead of a Form you can do what you want. tuaFrame:=TUniFrame1.Create(self); tuaFrame.Parent:=teuPainel; tuaFrame.Align:=alclient; tuaFrame.Visible:=true;…
delphianswered Tiago Rodrigues 849 -
1
votes1
answer328
viewsA: How to get the mysql table id by a combobox
What you want is the behavior of Tdblookupcombobox. This allows you to call one datasource and to define the field that the user sees (Listfield) and the one that you will use (Keyfield). But in…
-
2
votes1
answer1733
viewsA: How to read Json with multiple lists (DELPHI)?
You can use the System.JSON classes Here’s an example that parses your JSON to get the ID’s (There may be more direct way but you already have something to start) procedure…
-
3
votes2
answers498
viewsA: Trying to Quickly Open a Huge Table with Fdtable
If you have grids associated with these FDTable, do the disableControls() to 'cut' the table-grids link before opening it usually speeds up quite. Something like: FDTable.DisableControls;…
-
3
votes1
answer672
viewsA: Install only the app without overwriting the sqlite database that is already being used
If you are copying the file with the sqlite to the android through the menu Project->Deployment, you have an option there overwrite you can put to Never and so do not overwrite the file if it…
-
0
votes1
answer448
viewsA: Distinct Count no fastreport
As far as I know you have nothing done for it in Fastreports. The Count function does not have parameters to give you just the distinct. The best thing is to do it in the query, if you don’t want to…
-
4
votes1
answer976
viewsA: 'Could not Convert Variant of type (Null) into type (Double)'
In the assignment of null I’ve had trouble using the Value, then use the AsVariant thus: DataModuleGeral.tbHonorariosPERCENT_ADV_ASSIST1.AsVariant:= Null;…
-
0
votes1
answer29
viewsA: Access Violation with Finddragtarget
You are assuming that the Finddragtarget(Mouse.Cursorpos, True) function returns ALWAYS a value, which may not be happening. You should check it out first, something like…
-
1
votes1
answer3571
viewsA: Receive a Base64 string via JSON and display in a Timage DELPHI
Good You have to take the string and convert it to a stream, then use that stream to create the image. This is a code I have, to put an image on a devexpress button, but it should be enough to…