Jump to content

corneliusdavid

Members
  • Content Count

    409
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by corneliusdavid

  1. corneliusdavid

    Logging from RAD Server

    I looked in DocWiki but could not find it. This is a start, albeit not much more than viewing the source. Thanks for the link!
  2. corneliusdavid

    How to enter a float (currency) in TrzDBNumeric??

    Haha! It's caught me once or twice, as well. 🙂
  3. corneliusdavid

    allow cut & paste of numbers only..

    That's what I thought. LOL!
  4. corneliusdavid

    allow cut & paste of numbers only..

    Use TRzDBNumericEdit to save yourself some time.
  5. corneliusdavid

    How to enter a float (currency) in TrzDBNumeric??

    Uncheck IntegersOnly in the Object Inspector.
  6. I don't completely understand what you're wanting to do. I'll expand your example from Quality Portal: type TMyThingy = class(TParentWidget) public procedure Foo(AValue. string); override; end; implementation procedure TMyThingy.Foo(AValue. string); begin inherited Foo(AValue) // other code end; So right now in Delphi 10.4, I can use Ctrl+Click or Alt+UpArrow on the word "inherited" and it will take me to the inherited class's implementation of Foo, namely TParentWidget.Foo in my example. Your request is that those same hotkeys also work on the word "override"?
  7. corneliusdavid

    Copy Encrypted InterBase Database to another machine

    Thanks. I have two instances of IB installed on my Windows server, both 2020. I had updated the RAD Server one recently with last October's update but forgotten to do the other one until you mentioned it. However, the most recent gds32.dll was already in the Windows\SysWOW folder. I tried IBConsole from the server again just now and it seems to be working again.
  8. corneliusdavid

    Copy Encrypted InterBase Database to another machine

    Yes, that's what I had done. Originally, as mentioned in the blog, I had IB XE7 and IB 2017 installed both listening on different ports. I installed RAD Server and its IB 2020, all using TCP/IP and without changing anything with the first two installs, could no longer access the XE7 or 2017 instances. I'm not sure what happened but I know it was installed in its own directory and was using a different port. Thank you very much for the detailed response on being able to use multiple instances of InterBase on the same machine. I'm pretty sure I followed rule #2 above. I'm accustomed to carefully configuring ports and have used multiple databases and even stand-alone and web-based servers on the same machine before, all without conflict. That's good to know. I had gone looking in the Windows registry for settings to see if something had gotten clobbered. One weird problem I noticed was when I tried to use a different style. I got more error messages until I switched back to the standard Windows style. I thought that was really weird as I can't imagine how the style would affect database connections. After discovering IB 2020 Developer does work with RAD Studio's IB 2020 on a different port, and after continuing to have intermittent problems with IBConsole, I switched to a different client database program, IBExpert, and it works flawlessly. So I think most of my problems stemmed from using IBConsole--and I will avoid using that completely from now on if I can. Thanks again for your response and thorough answers. I really appreciate it. 🙂
  9. corneliusdavid

    Copy Encrypted InterBase Database to another machine

    So, I was writing up a blog about this after I had completely uninstalled all InterBase versions that were not installed by RAD Server and wanted to grab a screenshot from one of the errors, so quickly reinstalled IB and created a quick test database to see the error but this time it worked. The only difference (that I can think of) was that I did not use a database alias to connect! My blog now proclaims that that you CAN use a development license of InterBase in addition to an InterBase instance using the production version of RAD Server. I had been using IBConsole to create and connect the databases and am now very leery IB aliases and any error message in IBConsole as I believe (and have seen reports elsewhere) that it has a lot of bugs. My one remaining question now is this: Is what I have done a violation of licensing? My home Windows Server is for development and testing so applying the developer license of InterBase should not be a problem. I don't have a use for the production license of RAD Server with a customer and would like to test applications with more than 5 users, so figured it wouldn't be a problem to use it on my Windows server alongside development databases. Perhaps that's not what was intended for Delphi Enterprise users but I did not see any restriction mentioned in the EULA on where that license could be used (except within the same country you purchased it).
  10. corneliusdavid

    Refactoring issue in 10.4.2 re: Rename

    Same here. In fact, using the Rename hotkey, Ctrl+Shift+E, while it works for pre-defined vars (sometimes) when activated on an inline var, acts the same as if it was activated in white-space, which oddly enough, brings up Incremental Search instead (as if you had it Ctrl+E instead). Fortunately, SyncEdit works really well (Ctrl+Shift+J).
  11. corneliusdavid

    FireDAC+SQLite

    I would save the GUIDs as TEXT fields, not binary. They could even be stored as numbers in the TEXT field as SQLite is very loose with it's storage compared with Delphi. Read about them here: https://www.sqlite.org/datatype3.html There are no generators in SQLite. You're probably very used to using them in Firebird or InterBase. Instead, you might consider the AUTOINCREMENT feature of the INTEGER type but there are some considerations to using that as well.
  12. corneliusdavid

    Copy Encrypted InterBase Database to another machine

    Sriram, Thank you so much for your detailed response. I had indeed read every link and technical resource I could find, even scanned all through David I's book. I found and learned lots of information but never found anything about using InterBase as the database for installed RAD Server modules--I just assumed it would be possible as it seems like the natural choice for RAD Server modules. In my opinion, this seems wrong (or greedy). They promote RAD Server which uses encrypted InterBase and they promote the use of InterBase for your applications. But when you install RAD Server and InterBase together, fully licensed with RAD Server, you can only use RAD Server, you can't use the fully capable, licensed, running InterBase without purchasing another license. I could understand restricting InterBase use only through RAD Server modules but I guess that might be technically difficult to enforce. Thanks again!
  13. I was surprised to check this thread this morning and see all the comments. I guess I should've mentioned I had already refactored this. Since I despise both GOTOs and EXITs, I rewrote it without any of them: function BlankControl(EditControl: TObject; const EditMess: string; ShowErrorMsg: Boolean; MaxLen: Integer): Boolean; begin // assume False, prove otherwise Result := false; if EditControl is TCustomEdit then Result := length(trim((EditControl as TCustomEdit).Text)) < MaxLen else if EditControl is TComboBox then Result := length(trim((EditControl as TComboBox).Text)) < MaxLen else if EditControl is TDBComboBox then Result := length(trim((EditControl as TDBComboBox).Text)) < MaxLen else if EditControl is TDBRadioGroup then Result := length((EditControl as TDBRadioGroup).Value) = 0 else if EditControl is TDBLookupComboBox then Result := length((EditControl as TDBLookupComboBox).Text) = 0 else if EditControl is TDBCheckBox then Result := (EditControl as TDBCheckBox).State = cbGrayed else KSMessage('control is not edit checked kslib', mtError, 0); if Result then Showerror(EditControl, EditMess, false, ShowErrorMsg); end; I guess I had also left out the final "else" clause in my original post--sorry about that, it's included here.
  14. I recently inherited an old project that had many bad code examples that looked like whenever anyone made a change to the code, they just left it like they found it instead of refactoring. There were empty IF-blocks, while-true loops, exit statements one line before the end of a procedure, and one of my favorites: for j := 0 to 0 do begin Temp := StartTop[j] + CompRow; CreateLabel(CNameL[j], LeftSide - 4, Temp, 150); ... All of these were in that ONE project. But the worst code in that I found in that project was a bunch of GOTOs: function BlankControl(EditControl: TObject; const EditMess: string; ShowErrorMsg: Boolean; MaxLen: Integer): Boolean; label 900, 1000; begin if EditControl is TCustomEdit then if length(trim((EditControl as TCustomEdit).Text)) < MaxLen then goto 1000 else goto 900; if EditControl is TComboBox then if length(trim((EditControl as TComboBox).Text)) < MaxLen then goto 1000 else goto 900; if EditControl is TDBComboBox then if length(trim((EditControl as TDBComboBox).Text)) < MaxLen then goto 1000 else goto 900; if EditControl is TDBRadioGroup then if ((EditControl as TDBRadioGroup).Value = '') then goto 1000 else goto 900; if EditControl is TDBLookupComboBox then if ((EditControl as TDBLookupComboBox).Text = '') then goto 1000 else goto 900; if EditControl is TDBCheckBox then if ((EditControl as TDBCheckBox).State = cbGrayed) then goto 1000 else goto 900; 900: Result := false; exit; 1000: Result := true; Showerror(EditControl, EditMess, false, ShowErrorMsg); end;
  15. corneliusdavid

    Vcl to Fmx

    For converting VCL to FireMonkey, the only tool I know if is Mida Converter. Disclaimer: I have not used it myself, so don't know how well it works. I don't use grids as often in mobile apps as I do in desktop apps, which is mostly what I use FireMonkey for so far, but I've had good success hooking up TGrid to datasets with LiveBindings.
  16. corneliusdavid

    Run Time Sub Menu Gap

    Ah! TAdvMainMenu! That explains it. I was thinking that didn't look like the regular TMainMenu. My attempt to replicate it also failed.
  17. corneliusdavid

    Run Time Sub Menu Gap

    It would help if you showed the code that you tried. You could also create one sub-menu at design-time, then look at the text view of the .dfm to see all the properties it sets to give you a clue.
  18. corneliusdavid

    Class tree utility released

    Nice, that works pretty well. (You accidentally listed the URL twice so you might want to edit your post and correct it.) Why did you include the DelphiEncryptionCompendium units? Was that just to test? They aren't really needed for the functionality of the app. It'd be cool if there was a search button so you could quickly find a specific class in the huge generated list.
  19. corneliusdavid

    Disable & re-Enable a Procedure

    Lajos, Yes, but if you're enabling/disabling from within the data module you don't need to preface it with the variable name.
  20. corneliusdavid

    Disable & re-Enable a Procedure

    So I gather you have a data module with an Orders table or query where one of the fields is DOCNO and you double-clicked on the OnChange event handler in the Object Inspector to create the procedure. So to clear it at runtime in code you would clear the OnChange property of the DOCNO field. In other words, you were very close: dm.Orders.DOCNO.OnChange := nil; And you would hook it back up again by reassigning the created procedure name: dm.Orders.DOCNO.OnChange := OrdersDOCNOChange;
  21. corneliusdavid

    Can one include a TDataModule in a console application?

    Yes, absolutely! If you want to write a server app or a web module, this is the best way to go as debugging a console app is very simple and the data module can be shared between the two projects. I do this quite frequently. Here's a sample console project loading a data module: program ConsoleProjectTest; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, udmUnit1 in 'udmUnit1.pas' {dmUnit1: TDataModule}; begin try dmUnit1 := TdmUnit1.Create(nil); try // do stuff with data module finally dmUnit1.Free; end; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. Hope that helps!
  22. corneliusdavid

    Need some enlightenment

    Before you go to too much work, you might want to read this blog if you haven't already. If you really need to convert this C# code, it would be helpful to see more of the definitions of the object types but here's a first stab... var tblProp: TableProperties; TopBord: TopBorder; BotBord: BottomBorder; // ... begin TopBord := TopBorder.Create; TopBord.Val := BorderValues.Dashed; TopBord.Size := 24; BotBord := LeftBorder.Create; BotBord.Val := BorderValues.Dashed; BotBord.Size := 24; // etc. tblProp := TableProperties.Create(TableBorders.Create(TopBord, BotBord... If the xxxBorder classes have parameterized constructors, it would look closer to C#: var tblProp: TableProperties; begin tblProp := TableProperties.Create(TableBorders.Create( TopBorder.Create(BorderValues.Dashed, 24), BottomBorder.Create(BorderValues.Dashed, 24), LeftBorder.Create(BorderValues.Dashed, 24), RightBorder.Create(BorderValues.Dashed, 24), InsideHorizontalBorder.Create(BorderValues.Dashed, 24), InsideVerticalBorder(BorderValues.Dashed, 24)));
  23. I just downloaded the sample shoplist database and opened it in SQLiteStudio and the table is empty. Perhaps add some records outside of your app, then if your app is still not showing anything, you'll know something is amiss in your data connection or LiveBindings. When making changes to a view that don't appear to affect the display on your phone, try changing a different view or adding a label to the master view. When I was getting up to speed with mobile development, there would be times I thought for sure I was modifying the right view only to find out the phone was a different size than I expected or I had inadvertently switched views. Once you verify what view to use, you shouldn't need to uninstall the app--it'll update it.
×