Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by corneliusdavid

  1. corneliusdavid

    ToolsAPI for D11 Welcome Page?

    Does anyone know if there will be documentation and/or source for supporting the new Welcome Page plugins in Delphi 11? I like this version's Welcome page much better than previous versions and it's nicely configurable but would still like to be able to create my own additions. I see several WelcomePage.Plugin.XXX packages in the \bin folder and listed under "Known IDE Packages" in the registry but there doesn't seem to be any corresponding source code in the source\ToolsAPI folder of the Delphi 11 installation.
  2. corneliusdavid

    KSVC gone missing.

    It's installed in my Delphi 11.
  3. corneliusdavid

    Parnassus Bookmarks for Delphi 11 Alexandria?

    YES! I use this multiple times a day.
  4. corneliusdavid

    Lost the Build Groups pane in D11.0

    Not for me. I had never used Build Groups before, opened a project group, clicked the Build Groups button and saw the Project pane go blank. That was last night. Tried it again this morning and it works fine. Defined a Build Group, compiled, closed down Delphi 11, brought it back up, reopened the Build Group--still see it. That was weird but at least it works again.
  5. corneliusdavid

    Lost the Build Groups pane in D11.0

    It doesn't work for me either. Delphi 10.4.2 does show Build Groups. I can't imagine it's anything we did.
  6. corneliusdavid

    wuppdi Welcome Page for Delphi 11 Alexandria?

    Why? Were they causing a problem?
  7. corneliusdavid

    Delphi 11 Installing vcl component

    Is your package using something that pulls in getit or welcomepage? I've never seen this and have compiled components in D11.
  8. corneliusdavid

    Why empty dynamic arrays = NIL?

    No, a TList is similar to the dynamic array with no elements in this case, it's just declared but doesn't point to anything yet until the Create constructor is called, THEN it points to the allocated memory for the TList. Even though TList, at that point, doesn't have any items, it still has other properties like Count which is initialized at Create to 0. The dynamic array isn't a class, in other words, it doesn't have other properties, such as Count, which is why you have to use the Length() function.
  9. corneliusdavid

    Why empty dynamic arrays = NIL?

    And to further clarify my "array declaration" statement, a dynamic array declaration doesn't allocate the space for it until its length is set to at least 1.
  10. So what I would suggest is either try out Uwe's code above or look at the GExperts code (it's open source) to figure out how they do it. Also, since you're specifically wanting to use the three components generated by the REST Debugger, you could compare the components it creates with the values in the paste buffer and do a little parsing to set the values for those specific components.
  11. corneliusdavid

    Why empty dynamic arrays = NIL?

    To expand on what Uwe said, an array declaration allocates space for the variable and creates it when it's declared, much like an integer or string. Changing it's length sort-of redeclares it. This is in contrast to the TList<T> where the declaration doesn't allocate space for the variable (instantiate it) so you have to actually call its Create constructor. Before it's "created" then, it's nil.
  12. Or do you want the user to actually use the REST Debugger, click the Copy Components button, and go to your running application and do the paste while it's running? So you want to convert the pasted objects to "create" statements--is that what you're after?
  13. Exactly. So just put the code in the OnCreate of the form and they'll be created at run time.
  14. Pasting components to the form is essentially creating the components and hooking them to the form. How does this code not do exactly that? What else are you looking for?
  15. Any component can be created in code at runtime. Here's the code for your posted set of components: var RESTClient1: TRESTClient; RESTRequest1: TRESTRequest; RESTResponse1: TRESTResponse; begin RESTClient1 := TRESTClient.Create(Self); RESTClient1.Name := 'RESTClient1'; RESTClient1.BaseURL := 'https://api-eu1.XXXXXXXXXXXXXXX/ORD'; RESTClient1.Params := <>; RESTRequest1 := TRESTRequest.Create(Self); RESTRequest1.Name := 'RESTRequest1'; RESTRequest1.AssignedValues := [rvConnectTimeout, rvReadTimeout]; RESTRequest1.Client := RESTClient1; RESTRequest1.Method := rmPOST; with RESTRequest1.Params.Add do begin Kind := pkHTTPHEADER; Name := 'x-api-compleat-key'; Value := '0aXXXXXXXXXXXXXXXXXXXXXX94'; end; with RESTRequest1.Params.Add do begin Kind := pkREQUESTBODY; Name := 'body9BE6CF603159471FB026D7FF6FC3D2DB'; Value := ; ContentType := ctAPPLICATION_JSON; end; RESTRequest1.Response := RESTResponse1; RESTResponse1 := TRESTResponse.Create(Self); RESTResponse1.Name := 'RESTResponse1'; end; The GExperts IDE plugin has a very easy way to generate this. After it's installed, simply right+click on a component and select "Components to Code" and the code to generate the component is copied to the clipboard. Then just paste them into your code editor. It does one component at a time so I had to combine the three RESTxxx components into the VAR section after each one but it's really as simple as that.
  16. corneliusdavid

    web scraping or web parsing for project?

    I would suggest looking at one of Embarcadero's latest acquisitions, ApiLayer; they have a web-scraping API. Don't know anything about it but "Turn web pages into actionable data" (scraped from their website) sounds like what you're trying to do.
  17. corneliusdavid

    IOS 15 suppoort

    Thank you for these details!
  18. corneliusdavid

    Parnassus Bookmarks for Delphi 11 Alexandria?

    Bookmarks and Navigator are my favorite Delphi IDE plugins--hope it's not much longer!
  19. corneliusdavid

    Regex help please..

    LOL! We all get stuck in a train of thought once in a while! I've definitely been there. 😎
  20. corneliusdavid

    Regex help please..

    I think I would split the string on semicolons and run the regex on each individual address. function ValidEmail(const EmailAddress: string): Boolean; const EMAIL_REGEX = '^((?>[a-zA-Z\d!#$%&''*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])' + '[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)' + '(?>\.?[a-zA-Z\d!#$%&''*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])' + '[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]' + '{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d))' + '{4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\' + '[\x01-\x7f])+)\])(?(angle)>)$'; var Emails: TStringList; begin Result := True; Emails := TStringList.Create; try Emails.Delimiter := ';'; Emails.StrictDelimiter := True; Emails.DelimitedText := EmailAddress; for var i := 0 to Emails.Count - 1 do if not IsMatch(Emails[i], EMAIL_REGEX) then begin Result := False; Break; end; finally Emails.Free; end; end;
  21. corneliusdavid

    read integer value from database, best practice ?

    Within both the context of the original question and my response, we were talking specifically about Integer fields--not strings or floats or memos.
  22. corneliusdavid

    Delphi 11 Alexandria: New Edit Window

    Just because it doesn't have features you think are necessary doesn't mean it's useless. I really like this new window as I can open this up and move it to a second monitor so I can see either a different section of the code or the design view of the form while editing the code. In this use case, it wouldn't make sense to have it dockable. Also, I wouldn't need it for every unit, just occasionally for some forms or data modules--when I need it, the feature is there. I can see the benefit for making it dockable and saving it as part of a desktop layout but that's not the first thing I thought of. I'm glad they added this feature. Perhaps there will be a dot release with enhancements you suggest.
  23. corneliusdavid

    read integer value from database, best practice ?

    If you know there's a space in the field, then the code you listed, "Fieldbyname('IntegerField').AsInteger" is misleading as that is most definitely NOT an IntegerField as Integer fields cannot have spaces (well, SQLite might allow it). If your "integer" field might possibly contain values other than integers, you will have no choice but to test to make sure it actually contains an integer before trying to use it as one. The AsInteger function doesn't check the data type, it just assumes you know what you're doing with your database.
  24. corneliusdavid

    How to run Interbase developer in 10.4 and 11

    Yes, FireDAC can connect to local or remote database, the same as IBConsole and you can view remote data from within the Delphi IDE. You just specify the SERVER and PORT to point to the other machine. And, of course, remember that the database filename is local to the SERVER, not the local machine (e.g. don't give the network share name of the location of the database). One thing to keep in mind if you have multiple instances of InterBase: each one has to be licensed separately--you can't use the same license for two different ones. It'll probably run fine for a short while but you'll soon run into the license problem like I did.
  25. corneliusdavid

    How to run Interbase developer in 10.4 and 11

    When I installed Delphi 11, I skipped the InterBase install since I already had IB 2020 installed so I only have one instance of IB 2020 installed on my developer machine. OK, I should explain--that screenshot is misleading. I originally installed IB 2020 with Delphi 10.4 on my developer machine. Then, I started doing some testing with web modules on my Windows Server under IIS so installed IB 2020 on there. After I registered that and started using it there, when I try to open a database on my developer machine, it tells me the license is already in use. I need to uninstall it from my developer machine--the only one I can really use in that screenshot is the one at the IP address that points to my Windows server. I included the screenshot to show that it's possible to register multiple databases with different instance names and ports. Sorry for the confusion. But to answer your question about how to setup up multiple databases in IBConsole (if that's what you wanted to know), when you right+click on "InterBase Servers" and select Add..., you get prompted for local or remote. For my Windows Server, I selected Remote and entered it like this: Hope that helps.