-
Content Count
1406 -
Joined
-
Last visited
-
Days Won
22
Everything posted by programmerdelphi2k
-
Delphi 10.4.2 Right Click over a word -> Find Declaration, Not working.
programmerdelphi2k replied to Juan C.Cilleruelo's topic in Delphi IDE and APIs
unfortunatelly, RAD "11.2" still bugged in many points! Frequently I have that "close/open" (same that simple project with 1 form 1 unit) because the "LSP" or "Code Insight" its basic functions... like: show properties on a classes, after any other problem (for example: a command wrong writed, and later fixed)... then the code-completion does not works anymore!... needs close/open the project!!!! it's very boring- 45 replies
-
- 10.4.2
- find declaration
-
(and 1 more)
Tagged with:
-
A simple way to "replace" ( I say: betweem quotes ), would be! create a unit with your "procedure/function" called: ShowMessage(...) -->( with same params then "showmessage by Delphi") in all units desired, you would put it in "last" place on "USES" clause! then, you can replace the "occurrence" this way: uses ..... others, ..... MyNewSHOWMESSAGEunit; ... where is: ShowMessage(....) ... you change to: MyNewSHOWMESSAGEunit.ShowMessage(....) then, nothing really would be changed on "Delphi sources", only a "workaround" (bad) but works! this is done when needs "avoid" conflicts, then, you use "namespaces" from units, or types! including, you can "use this unit name" in your Project-Options->Compiling-> Unit Aliases... unit uMyNewSHOWMESSAGE; interface interface procedure ShowMessage(const AText: string); implementation uses Vcl.dialogs; procedure ShowMessage(const AText: string); begin Vcl.dialogs.ShowMessage('My ShowMessage: ' + AText); // ... or, your customized code here end; end. var Form1: TForm1; implementation {$R *.dfm} uses uMyNewSHOWMESSAGE; procedure TForm1.Button1Click(Sender: TObject); begin Vcl.Dialogs.ShowMessage('Hello'); // by VCL // needs because the same names and uses clause above! // uMyNewSHOWMESSAGE.ShowMessage('hello world'); // your ShowMessage! end;
-
BatchMove using FireDAC: missing fieldnames and tablename (solved)
programmerdelphi2k replied to JohnLM's topic in Databases
with FireDAC framework it's easy: implementation {$R *.dfm} { 1 FDGUIxWaitCursor 1 FDBatchMove 1 FDBatchMoveTextReader 1 FDBatchMoveDataSetWriter 1 FDMemTable 1 DataSource 1 DBGrid // 1 FDBatchMove (if dont using same than above) 1 FDBatchMoveDataSetReader 1 FDBatchMoveTextWriter } procedure TForm1.FormCreate(Sender: TObject); var MyField: TFDTextField; begin MyField := FDBatchMoveTextReader1.DataDef.Fields.Add; MyField.FieldName := 'ID'; MyField.DataType := TFDTextDataType.atLongInt; // MyField := FDBatchMoveTextReader1.DataDef.Fields.Add; MyField.FieldName := 'First_Name'; MyField.DataType := TFDTextDataType.atString; // MyField := FDBatchMoveTextReader1.DataDef.Fields.Add; MyField.FieldName := 'Birthday'; MyField.DataType := TFDTextDataType.atDate; // FDBatchMoveTextReader1.DataDef.Delimiter := '"'; // FDBatchMoveTextReader1.DataDef.EndOfLine := TFDTextEndOfLine.elDefault; FDBatchMoveTextReader1.DataDef.Separator := ','; FDBatchMoveTextReader1.DataDef.WithFieldNames := false; // if your MyData.txt does not have "field names" on first line!!! // FDBatchMoveTextReader1.FileName := '..\..\MyData.txt'; end; procedure TForm1.Button1Click(Sender: TObject); // reading from MyFile.txt begin FDMemTable1.Close; // FDBatchMove1.Reader := FDBatchMoveTextReader1; FDBatchMove1.Writer := FDBatchMoveDataSetWriter1; // FDBatchMoveDataSetWriter1.DataSet := FDMemTable1; // DataSource1.DataSet := FDMemTable1; DBGrid1.DataSource := DataSource1; // FDBatchMove1.Execute; end; procedure TForm1.Button2Click(Sender: TObject); // write on MyFile.txt begin if FDMemTable1.Active and (FDMemTable1.RecordCount > 0) then begin FDBatchMoveDataSetReader1.DataSet := FDMemTable1; // FDBatchMoveTextWriter1.DataDef := FDBatchMoveTextReader1.DataDef; FDBatchMoveTextWriter1.FileName := FDBatchMoveTextReader1.FileName; // FDBatchMove2.Reader := FDBatchMoveDataSetReader1; FDBatchMove2.Writer := FDBatchMoveTextWriter1; // FDBatchMove2.Options := FDBatchMove2.Options + [poClearDest]; FDBatchMove2.Execute; end; end; 1,"john",12/12/2022 2,"peter III",13/12/2022 3,"paul IV",14/12/2022 4,"mary",15/12/2022 now, study about "FDBatchMoveSQLReader / FDBatchMoveSQLWriter" components to SQL usage!!! -
Detect when/what makes a tcomponet descendent is made NIL?
programmerdelphi2k replied to alogrep's topic in VCL
my first tip: avoid "WITH" usage, always that possible! it's messy and leads to basic error induction, even though everything looks ok in the build! if "G" it's your component, then, maybe you should look before this line... what happens before this line? "With G do..." because, when "G" ...ColCount.../ Cells[...] / ...CellColors[...] etc... --> if "G" is nil, then you catch a "AV". -
Detect when/what makes a tcomponet descendent is made NIL?
programmerdelphi2k replied to alogrep's topic in VCL
none code ? -
Searching for full-time remote position...
programmerdelphi2k replied to Rick_Delphi's topic in Job Opportunities / Coder for Hire
Daniele Tetti needs "some hands" by starting on 32K + goods see on this forum -
Include External Text Files in Output Folder
programmerdelphi2k replied to Jeff Steinkamp's topic in General Help
@Rollo62 what he want is: transfer the 4 files (txt, cvs, scripts at general) to target app-folder to use it "on future"! not just have the "data" into app!!! like as: "Please, sir RADStudio copy my files xxxx, because I want use it later in my app"... 🙂 -
Include External Text Files in Output Folder
programmerdelphi2k replied to Jeff Steinkamp's topic in General Help
here my sample to MSWindows, but works in any other platform where PAServer works! Install your PAServer in your MSWindows (same PC or PC target - does not matter, since the the PC can be seen by RAD IDE, or be, same network!!! "setup_paserver.exe" is in: C:\<<installation-dir>>\PAServer on PAServer command line type: paserver -unrestricted -scratchdir=<<d:\MyNewScratchDirToPAServerDeployment>> // it's ready! here it's where your new project + files will be placed run it and go back to RAD IDE! config your "Deployment" setup as above, indicating what files you need deploy together with your exe/dll now, build your project now, in "Deployment", just click "Deploy" button... as you dont have your "profile" created, the IDE ask to create it... then do it now! give a name, inform the IP where PAServer is running + password if used ... test connection! it's ready! NOTE: PAServer show the IP/Port using command "i" and "p" in your console! -
me, sorry about you! see you later!
-
you send me a link with DB +1GBytes ... it's not possible download, I said to you!
-
as I said, your root-problem is your "record" in special... then: try just use your "SQL manager" to copy it for another "NEW" database! that way, your SQL file (target) will be cleaned of any "superfluous data", and the new record (if everything ok) can be more wiped! In case of problems with corrupted data, SQL-manager can try to recover some information! But if, really, what you told me in the private-message is true, a record that is 1GBytes in size, then, certainly this is the real cause of the problem, because, when loading this 1GB, in a new "stream" , you could have 2GB or more as a result, because 1GB of the record + 1GB of the stream, and, who knows, +1GB of the visual component = 3GB, do you understand?
-
Include External Text Files in Output Folder
programmerdelphi2k replied to Jeff Steinkamp's topic in General Help
You misunderstood! after build your project, just use "Deployment" "button" to deploy your project+any files on setup -
it's a mistery!!! but MSWin11 is broken anyway!
-
upgrade How long does it take to update Delphi 11?
programmerdelphi2k replied to Mr. E's topic in General Help
you can register your key in my.embarcadero.com and download your iso, not? -
if we look a little deeper... who is actually called?
-
upgrade How long does it take to update Delphi 11?
programmerdelphi2k replied to Mr. E's topic in General Help
always prefere download ISO for avoid any problems while installing ... here RAD Studio 11.2 complete = +18GBytes in disk after installation! -
upgrade How long does it take to update Delphi 11?
programmerdelphi2k replied to Mr. E's topic in General Help
Let's enumerate... Embarcadero servers decongested = OK Mega-fast user internet (ultra-broadband) = OK User's computer latest generation and mega-fast = OK No software to disturb the download = OK user using a VM with many gigabytes of RAM and disk (+100GB) = oh oh oh will it? ... let's wait and see.... until the end, cross your fingers and hope that no problems with the connection to Embarcadero, or even, no internal errors during the installation!!! NOTE: download ISO (+6gb) in order not to get bored! -
Why is ShowMesssage blocking all visible forms?
programmerdelphi2k replied to Mike Torrettinni's topic in VCL
you can use "NotificationCenter" class in MSWin10 !!! -
Look, ShowMessage calls indiretly "MessageDlgPosHelp(Msg, DlgType, Buttons, HelpCtx, X, Y, '');".. then you can define "X,Y" values for your position desired! ... a little more deep... you'll find a called to "TTaskMessageDialog"... then, use it directly! INPUT dialogs, in fact, is a "FORM" customized! just do yours!
-
I think that what you are asking for at this point would not be "at all acceptable", from the point of view of good programming practices! (I hate these words: "Good programming practices") Why? Simple, replacing something already enshrined in the environment, whatever it may be, programming, social relationships, etc... is, at the very least, exhausting, not to say, many times, impractical! (even if possible). If you insist in this direction, be aware that you will certainly have a lot of headaches... not too far away! To make such a maneuver, change a class, or even a function as common as "ShowMessage", you should first assess the risk of compromising your project today and all the rest! You would have to assess the consequences of such a drastic change! My advice: forget this wish, and ask the genie in Aladdin's lamp for another one. You can try the following: if you don't have or don't want to use another tool, for example, NOTEPAD++ to replace an occurrence with another occurrence! - this tool lets you do it in a simplified way! using the "reFind" tool (which is in the "BIN" directory of RAD Studio), you could find a given occurrence and replace it with another one! However, you need to "move" your brain a little to create your desired command. Anyway, you can read about this command on the Embarcadero page (DocWiki) or even on the Embarcadero Blob about "reFIND".
-
Include External Text Files in Output Folder
programmerdelphi2k replied to Jeff Steinkamp's topic in General Help
hi @Jeff Steinkamp you can choice between two ways above (or any other existent on RAD Studio, of course) you can use: "DEPLOYMENT" --> indicated for your case! because you want "indicate the "TARGET folder" OR.... I say "OR" add your files using "Project Manager" -- here, you cannot do it! So, you'll have two ways to do it!!! --> two independent ways !!! Using the "COMPILING EVENTS", it's for anothers tasks... but it's possible adapt it!!!! the compiler/linker can execute anothers "commands" before, pre, or after actions! then, you would can, for example, execute a ".BAT" file/EXE/COM/VBS/etc... to execute any task before/pre/after your building... you see? --> I think that it's not your case here! -
Include External Text Files in Output Folder
programmerdelphi2k replied to Jeff Steinkamp's topic in General Help
In RAD Studio it's so easy too! you can add any file in your project, of course, your "EXE"/DLL/etc... it will be "bloated" depending on the type of file you will include! in your case, I think that using "Deployment" menu will be better, because you can define where yours files will be placed, including what names it will have! other way, you can use the "events"when compiling your project... but I think that your better choice is "Deployment" -
I think it would be better then to use polymorphism, as the need is just to create a form according to the current value contained in a polymorphic variable! No? Already, using "TFormClass", you exempt yourself from such a maneuver, because the very definition of the "type class" is generic for forms! Myslím, že potom by bolo lepšie použiť polymorfizmus, pretože je potrebné len vytvoriť formulár podľa aktuálnej hodnoty obsiahnutej v polymorfnej premennej! nie? Už pri použití „TFormClass“ sa oslobodíte od takéhoto manévru, pretože samotná definícia „triedy typu“ je pre formuláre všeobecná!
-
procedure TForm1.Button1Click(Sender: TObject); var PersistentClass: TPersistentClass; FormX : TFormClass; begin //FindClass(...) raise an exception if not found, then is better use "GetClass(...)" directly! PersistentClass := GetClass('TForm4'); // if (PersistentClass = nil) then exit; // FormX := TFormClass(PersistentClass); // TForm4 does not exist in my project...then will raise an exception using FindClass(...) if (FormX <> nil) then FormX.Create(nil).ShowModal; end; NOTE: Better use a "Local variable" and "FREE it" after usage! xx := TMyForm.Create... try ... finally xx.Free; end;
-
or... unit uMyRegisterForms; interface uses System.Classes; implementation uses Unit2, Unit3; initialization RegisterClass(TForm2); RegisterClass(TForm3); end. var Form1: TForm1; implementation {$R *.dfm} uses uMyRegisterForms; procedure TForm1.Button1Click(Sender: TObject); var FormX: TFormClass; begin FormX := TFormClass(FindClass('TForm2')); // TForm3 if (FormX <> nil) then FormX.Create(nil).ShowModal; end; end.