Jump to content

MarkShark

Members
  • Content Count

    91
  • Joined

  • Last visited

Community Reputation

27 Excellent

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Peter you are 100% correct! S := '1' + V; works and returns 24 (both if V has a bcd, or if it just contains an integer.) It looks like this is just my own misinterpretation of how concatenating variants works. I always thought the conversion took into account the type of the first "item" in the concatenation. And agreed on the bug thing, I always go with "Issue" until someone else confirms things (or I learn something new, which is always appreciated!)
  2. Hi All, I was doing some work with database parameters containing a binary coded decimal and ran into an odd issue with variants. It appears that converting a variant containing a TBcd to a string works fine, but converting and concatenating to another string does not. Any thoughts? Thanks! (I'm using Delphi 12.3 (with the latest patch) but have not tested on earlier versions to see if it's version specific.) procedure TForm1.Button1Click(Sender: TObject); // Example of issue. Uses System.Variants and Data.FMTBcd var V: Variant; S: String; Bcd: TBcd; begin Bcd := IntegerToBcd(23); VarFMTBcdCreate(V, Bcd); // This assignment works. S := V; // This concatenation fails (Delphi 12.3) // Project VarTestVcl.exe raised exception class EBcdException with message // 'Testing: is not a valid BCD value'. S := 'Testing: ' + V; end; Easy to work around, but seemed an odd issue!
  3. MarkShark

    Namespaces in Spring4d code

    This is very much a key point in this discussion. Spring4D includes the very, very nice build.exe tool which quickly and easily builds the library, can run tests, and conveniently adds the appropriate library path, debug path, and browsing paths to the IDE. I wish all third-party libraries did so!
  4. I recently came across this older stack overflow question: TAction.SecondaryShortCuts is language specific. How to set it correctly? The question is from 2012 and regarding Delphi XE2. If I'm interpreting this correctly, if I set a secondary shortcut to "Ctrl+J" (in English) then it won't fire if my application is run in say, Germany? I must just be reading it wrong or maybe it's something that's changed since then? Thanks for any insights!
  5. Interesting! I did not realize that that limit still existed. Here's a stack overflow link that discusses it and some solutions: Delphi INI readstring limitation.
  6. The situation: I'm trying to emulate a combobox using a buttoned edit control and another parented control as the "box". This works fairly well, but I want to handle the standard Windows combobox hotkeys for toggling the box visibility which are F4 (easy) and Alt-Up/Alt-Down (much less easy as it turns out since I almost always use the up down arrows on the numberpad.) The problem: Using Alt-Up and Alt-Down from the numberpad (as opposed to the up/down dedicated keys) generates alt code characters. This happens even if the numlock is off (I was surprised by this.) The only solution I've found: I'm just filtering out the possible alt-code characters in OnKeyPress. This isn't ideal as if you hold down Alt and just hit up or down like crazy you can generate a large number of different characters, and I'd like to filter them all or come up with a much better way than an overly large case statement. Any thoughts or ideas?
  7. MarkShark

    Bug: Lock Controls is not restored at IDE start!

    As a possibly related note. I've created a bug report Lock Controls not visible initially regarding that menu item having some issues when placed on an IDE toolbar. I always do this when I customize the IDE after install. It's a very useful feature.
  8. Hi all! Is there a library routine or api function that will compare two utf8 strings or buffers without converting them to UTF16? I'm looking for something analogous to AnsiCompareStr. Thanks! -Mark
  9. MarkShark

    TScrollBar PageSize & Max

    I did a lot of trial and error while working on the scrollbars for SynEdit and setting min to 1 seemed necessary. The code I ended up with is in SynEditScrollBars. The official documentation did seem a bit off in some cases. -Mark
  10. MarkShark

    Bug in TButton with Multi-Line Caption?

    Is this with Delphi 12 - Athens? Could it be related to this issue mentioned on Stack Overflow? To test if that's the issue just try changing #13#10 to + #13 + #10 to see if it makes a difference. Stack Overflow: Issue related to character literals: https://stackoverflow.com/a/78186835/113128
  11. MarkShark

    Notification message from an OmniWorkItem

    Just wanted to mention that I realize I can add a notification handler to the entire FWorker with: FWorker := Parallel.BackgroundWorker .NumTasks(1) .TaskConfig(Parallel.TaskConfig.OnMessage(HandleTaskNotification)) .Execute(HandleQueryWorkItem); But I'm wondering if I can do a WorkItem specific handler with the Schedule() call.
  12. I currently have a background worker that I use to serialize a queue of workitems. The code to create the worker is: FWorker := Parallel.BackgroundWorker .NumTasks(1) .Execute(HandleWorkItem); In this case the HandleWorkItem method is just a dummy method as I actually pass in the workitem code when I schedule the workitem. E.g.: FWorker.Schedule( FWorker.CreateWorkItem(TOmniValue.FromRecord(MyWorkItemDataRec)), FWorker.Config.OnExecute( procedure(const workItem: IOmniWorkItem) var TaskResult: TTaskResult; begin // Do a bunch of work here in a background thread // Now set the Result TOmniValue from a record. workItem.Result := TOmniValue.FromRecord(TaskResult); end) .OnRequestDone(DoneMethod) ); end; This works extremely well, but I'd like to notify the calling thread of the progress. I thought maybe that IOmniWorkItemConfig would have an OnMessage(eventHandler: TOmniTaskMessageEvent) that I could set during the Schedule call (much like OnRequestDone) but I haven't figured out how to do that. Any help or suggestions appreciated.
  13. MarkShark

    How to create new FireDac components

    Blast from the past! I worked at the Lab of Computer Science at Mass General Hospital right out of College (a great place with wonderful people.) I worked on Mumps for a few years back then. The database for Mumps/M is a hieratical database and it's not easy to do a direct translation to a relational database (based on knowledge from 30 years ago so it might be completely out of date! lol) In any case, I might look at Zeoslib instead of Firedac since it's open source and might be easier to create a new driver with. Sorry to not be more helpful!
  14. Issue #78 and my pull request to start to fix it is #79. I have it fixed and tested, just needed that last bit of info about the 11.2 problem. Works great in my testing so far.
  15. Thanks! Is using Searchbuf (unfortunately with the $if to fix this issue) ok to use as a solution to the SynEdit search engine issue I've been working on? Otherwise, we'd need a reverse version of the current "Next" function which looks like it might be a Boyer-Moore implementation?
×