Jump to content

corneliusdavid

Members
  • Content Count

    569
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by corneliusdavid

  1. corneliusdavid

    random between a range

    DOH! Corrected: value1 := random(250) + 1; value2 := random(250) + 251; value3 := random(250) + 501; value4 := random(250) + 751;
  2. corneliusdavid

    random between a range

    So you want 4 random values, one each in the ranges 1-250, 251-500, 501-750, and 751-1000, right: Try this: value1 := random(250) + 1; value2 := random(250) + 250; value3 := random(250) + 500; value4 := random(250) + 750; Each random number is restricted to a 250 range but adding a number to it puts it into different range brackets.
  3. corneliusdavid

    How should spaces after a comment be handled by the formatter

    Personally, I think a space after the comment makes it a little more readable. So I would opt for A1, B2, C2. But more importantly, I think comments should follow code or be on a separate line--I think comments before code on the same line break the vertical continuity of a block of code, causing the statement to be missed when the eye scans down a page. Therefore, like baka0815, I would much prefer a line-break option to move the statement to the next line.
  4. corneliusdavid

    Prevent Multiple Instance from running at the same time

    You might like using TMutex better: Preventing Multiple Application Instances in Delphi with TMutex
  5. corneliusdavid

    New proyect in Delfos

    If you have a large Delphi application with years of history and you want to add a REST server with as little learning curve as possible, RAD Server is fairly simple to get up and running--using existing skills. Scale? Did you know that RAD Server is deployed only as a module under the most popular web servers, IIS on Windows and Apache on Windows or Linux? I'm not sure what would scale more than that. There are many closed-source products on the market that are chosen because they are simpler to use or offer more features than open-source equivalents. I'm not saying RAD Server is the best but it's certainly an option that is worth looking at and will be a good solution for some people.
  6. corneliusdavid

    New proyect in Delfos

    It's just my read on it based on what I've seen. because they can make more money selling deployment licenses. I guess time will tell.
  7. corneliusdavid

    New proyect in Delfos

    I highly doubt that. There have been a lot of updates to RAD server recently. Also on https://blogs.embarcadero.com/, there has not been one single article about DataSnap since 2020 while there have been 15 on RAD Server in that same time-frame.
  8. corneliusdavid

    New proyect in Delfos

    DMVCFramework is a good way to build a REST server; it's open-source, well supported, and well documented but has a steep learning curve for newbies. RAD Server also allows you to build a REST Server but requires the purchase Delphi (or RAD Studio) Enterprise or higher, so it's not cheap if you don't already own that edition of Delphi. But neither of those solutions are explicitly "database in the cloud" products. They can be written to access databases and provide remote data but you can also host a database in the cloud and access it remotely from a standard Delphi app using database components. There are many reasons why building a REST server is a much better way to go but just thought I'd mention the option as I have done both.
  9. corneliusdavid

    Change Install Location

    It's the "Options" button and takes you to another page that is usually skipped; on that page, you can set the destination for both RAD Studio and the Catalog Repository folder, and also determine whether it's installed for "all users" (the default) or just the current user and whether or not to add a shortcut on the desktop.
  10. corneliusdavid

    Software only creates an error in RemoteApp

    Oh, some instances work fine? Then perhaps the users getting the error are accessing the one part of the program that doesn't work well with RemoteApp. It'd be interesting to know what the difference is between the ones that work and the ones that don't. One thing I remember from testing is that the software seemed to work fine while the user was in the main program; messages popped up, multiple windows, database access, fine (with permissions set properly). But the software was split into about four applications and when they needed to launch an ancillary program, there were problems getting to it. RemoteApp likes to be in control of the programs that are launched and, IIRC, this was the biggest hurdle we faced.
  11. corneliusdavid

    Software only creates an error in RemoteApp

    Yep, the software I was testing was very mature software, having run for hundreds of clients around the US for many years. And, like you noticed, some parts work fine, other parts raise errors. There may be simple software fixes to get around those--really depends on the program and what it needs to do.
  12. corneliusdavid

    Software only creates an error in RemoteApp

    I support some programs that are accessed via RDP and when I was first researching remotely running apps, I tried RemoteApp briefly but had a similar problem. While I don't recall what the exact cause of it was in that instance, it has to do with the application assuming resources are accessible in the same manner as they are when run from a standard Windows desktop--which RDP provides. It may have been something simple like checking for the screen size or something. In any case, we had to modify the program and even then only run it via RDP. I'm sure it would work through RemoteApp if it was a fairly simple program but when the Delphi code calls Windows API functions that are either not supported or return unexpected values and they aren't handled properly, weird things can happen. Sorry I don't have a better answer but yeah, you'll need to talk to the programmers.
  13. corneliusdavid

    Pos, SplitString

    Ah Yes! I love it!
  14. corneliusdavid

    Pos, SplitString

    I agree it's not near as readable. But it was sure fun to see if I could do it!
  15. corneliusdavid

    Theme or component??

    Excellent! Glad that helped. I just found a similar property in a DevEx grid control a few weeks ago with a similar need/solution.
  16. corneliusdavid

    Theme or component??

    So here are three ideas that might help: Customize the Color property of each tab (RzTabSheet) at design time (which doesn't affect the sheet's background color, just the tab color). Hook into the OnChange event of the RzPageControl and set the RzTabSheet's color for the selected tab. On the RzPageControl, uncheck the seFont option of the StyleElements property. I think this ignores the color that the Wedgewood Light theme would set and uses the Windows standard font color (clWindowText for this element). Using the third option, here's what my test looks like:
  17. corneliusdavid

    Pos, SplitString

    If by "shortest" you're trying to keep it to one line, this will work (you have to use the Math and StrUtils units): Result := IfThen(Pos('<', MyStr) > 0, Trim(LeftStr(MyStr, Pos('<', MyStr) - 1)), MyStr);
  18. corneliusdavid

    Theme or component??

    I'd say it's the color choices the RzPageControl chooses to use for it's background--partially because it uses a dark one for the tabs, so to make the selected one stand out, it uses a light background, which for Wedgewood, is too close to the font color. Here's a form using the Wedgewood theme with both the Standard PageControl (on the left) and the RzPageControl (on the right): The Sterling theme looks a little better as far as the contrast for the selected page but the whole form looks washed out (IMHO): The Aqua Light Slight seems to work well for light-colored themes: Just try several different themes until the control gives the right balance of colors in your application.
  19. corneliusdavid

    IOS shared document path access

    This doesn't directly answer your question but I did some comparison of the IOUtils paths on various platforms and learned a lot while writing this small open-source app: https://github.com/corneliusdavid/AppPaths. Maybe it will reveal some access limitations on iOS.
  20. corneliusdavid

    Android 11 Support in 10.4.2?

    I have a Google Pixel 3L phone running Android 11 and have had to use an old phone for all my Android development and testing. Delphi 10.4.2 proclaims it now supports Android 11 (API 30). So how do we get that?
  21. corneliusdavid

    Almdev component

    Which of their products? From their website: StyleControls: XE2+ ImageKit: XE3+ SmartEffects: D5+ BusinessSkinForm: D5+ So if you're only needing the last two, then Yes!
  22. corneliusdavid

    SqllocalDB

    https://docwiki.embarcadero.com/RADStudio/Sydney/en/Connect_to_Microsoft_SQL_Server_(FireDAC)
  23. corneliusdavid

    Line Break after i type 'if'

    Probably because the default "if" template is under C:\Program Files (x86)\... which is read-only. I'm guessing Delphi removes it from it's run-time list while it is open but re-populates the list from the files when it starts back up--and since the file itself was not deleted, re-reads it. If you really, REALLY want that "if" template to go away, close Delphi, manually delete C:\Program Files (x86)\Embarcadero\Studio\21.0\ObjRepos\en\Code_Templates\Delphi\if.xml, then re-start Delphi.
  24. corneliusdavid

    Line Break after i type 'if'

    Yes, this is the Live Templates feature of Delphi (one of my favorite productivity features, actually). A default set of templates gets installed in C:\Program Files (x86)\Embarcadero\Studio\21.0\ObjRepos\en\Code_Templates\Delphi as you discovered but remember that anything under C:\Program Files (x86) is read-only by default, so renaming or changing a Live Template from Delphi might not affect the actual file--or, as you encountered, you'd get the "Unable to create backup folder" error as Delphi tries to create a backup of the template before saving the new changes (which it will also fail to do unless you're running Delphi as Administrator). In addition to the default templates mentioned above, any new ones you create are stored in C:\Users\<your username>\Documents\Embarcadero\Studio\code_templates\Delphi. Since your user folder IS writable, you can rename/modify/delete the templates there all you want. You can turn off the auto-completion of the templates (which forces you to hit Ctrl+J to activate one) by going into Tools > Options > User Interface > Editor > Language, switching to the "Code Insight" tab, and unchecking "Auto complete" under "Code template completion".
  25. OK, one more interesting thing (I keep thinking of different ways to test this...): I was running D11 DPI-aware on my High-DPI monitor and it worked fine. When I right+clicked on the data module's editor tab and selected "New Edit Window" to open the data module in a separate (non-docked) window, then moved that window to a regular-DPI monitor, that's when I started having the same problems you described: moving components then saving, moved them back. If I re-docked the floating editor window back in Delphi, the problem stopped; if I moved the entire Delphi IDE to a regular-DPI monitor, the problem also stopped.
×