Jump to content

Pat Foley

Members
  • Content Count

    437
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Pat Foley

  1. Pat Foley

    Try-Finally-end; & Exit??

    The try...finally...end is typically used to free memory. This sample simply sets the count back to zero and has a counter for number of count resets in the finally. Goto's and try's don't mix. var Count: 0..100 = 0; Reentrant: 0..100 = 0; procedure TForm1.Button2Click(Sender: TObject); begin //Constraint If Count > 4 then exit; (Sender as TButton).Enabled := False; Inc(Count); Caption := 'Goingto ' + Count.ToString; Sleep(100); Try Caption := Format('Goneto %d',[Count]); If Count < 9 then begin Sleep(110); Button2Click(Sender); //Poor Person's ProcessMessages end; finally Inc(Reentrant); Count := 0; sleep(12_00); Caption := Format('Please !gotos!* use %d jumps',[Reentrant]); End; //* pram notation Beattie //Enables first finally pass :( (Sender as TButton).Enabled := True; end;
  2. Pat Foley

    Bringing the IDE automatically to the foreground?

    Works for me side by side... Notice how grouping shows a Instance paired with explorer it was paired with Help. I like the Startup layout and set the message and callstack views that popout in debug view. My only complaint is D12 icon same as D11 icon?
  3. Pat Foley

    Design of client/server application

    Here's some more Information for your consideration. https://svnbook.red-bean.com/en/1.7/svn-book.pdf Surely only copies of your documents are being looked at and double checked before changes are recorded into the system.
  4. Pat Foley

    open dialog

    Some Entities track employee's computer use and issue "warnings". What are your peers doing in like setups?
  5. Pat Foley

    open dialog

    Letting a user even see that another user's folder exists, even if it's not selectable, is just bad UI design and broken security waiting to be exploited. I would change this to mean each client 'sees' only one 'cloud' or 'channel'. Meaning the Admin for one client's machines would never see another client's channel machines and data. Have each client users use email and password to start windows and access their file share and shared drives as allowed by the logon of that user's account.
  6. Shouldn't that be PNativeInt(@ to allow either 32 or 64 compiling. The first 12 compile for me was 11K bigger but additional recompile yielded 45k smaller exe*. The displays show one NAN and blank "TokenWindow:bds.exe" *Did remove unused Controls from a package though.
  7. Pat Foley

    open dialog

    Use ShellAPI and ListBox or ListView perhaps. Try typing over the path in the FileOpenDialog location bar and see what happens with "cmd" or "explorer" text.😈
  8. Pat Foley

    Form still on display when property Visible = false

    In the past using Showing property never worked well for me... I just the removed the if Showing and just Hide and Show as needed. Also I added Step, Run, Stop buttons for timer state. A Step "freezes" the "program" if timer was enabled. If !timer.Enabled the Step does one OnTimer event. In runtime. Or say in Edit mode vs "Freeze". The State machine tells the Windows tiling what to do. The tiling should have not to deal with the State machine. This tiling either forms or controls get control when active or have focus. UI is dealt by State machine. The tiler (UI) plays the cards dealt. Also simply changing the parent of control can "show" or "hide" in a hurry.
  9. Pat Foley

    Testers needed for GExperts Instant Grep expert

    I plan to code an expert to verify the dcus are kept current with current source code because sometimes the current source code needs saved before the dcus are recompiled. I need to simply review and learn more before making additional comment.
  10. Pat Foley

    Debug for Win64 - blue dots are shifted

    It's frickle. If you save before each compile you increase your history files... But sometimes saving modified source needs done! The odd thing is debugging is running catching errors in 64 release for me. On a machine that hasn't been rebooted for four days. Side effect of .rsm file used on 64 side. Here I need to catch the exception surfaced to let the code run so undocumented or unknown to me feature.
  11. Pat Foley

    Testers needed for GExperts Instant Grep expert

    Thanks does GExperts have anything that looks at file age, I found that mentioned in Ray Lischner Hidden Paths of Delphi 3 wooden book. Then look at timestamps of the DCU to if the Build all compile processed everything. Sometimes the source needs saved first. GExperts actually catches when a license check fails which again is some good work.
  12. Pat Foley

    Testers needed for GExperts Instant Grep expert

    Here's my shot at it. Leaving GExperts as is and extend functionality with outside exe. There's a fantastic amount of work in GExperts and I am learning a lot reviewing the source and the comments in @dummzeuch Blog is quite helpful. Thanks. Running a task bar manager surfaces the GExperts showing in other desktops. What's interesting GExperts moves the active Delphi instance behind the taskbar with only the titlebar showing. Unsure here some GExperts hide with Delphi instance and docking forms get a taskbar icon.
  13. Pat Foley

    Running python code in Delphi threads

    Is a 2006 Programming Python by Mark Lutz still worth reading? Then use your guide to learn how use threads with Python. Thanks
  14. If you are in Windows use the tab key to change focus blue highlight in edit and caret insertion in the Memo or use mouse click to change focus.
  15. Pat Foley

    Debug for Win64 - blue dots are shifted

    Very good I put in seperate dcu64 path to be able to jump between 32 and 64 readily.
  16. Pat Foley

    Debug for Win64 - blue dots are shifted

    I been having some issues with that myself. Either try syntax check or a build all and check that all dcus or your timestamps are updated. On one project I found a library with a warning which when corrected made a big difference. I found that just closing and editing the project guid is easier but not always a fix.
  17. Pat Foley

    Delphi 11.3 : FORSAKEN

    Hard to do when phone numbers lead to full messages or simply when other sales reps are "poaching the order" with invalid phone number. If an order is paid early or in cash probably should be adjusted. The email of invoice does not have mail address preventing mailing a signed invoice back. Is improved that the poach operation is before renewal offer is sent. Several years before deals were sent after paying renewal offer. I think the company should treat subscribers as in a guild. This guild probably not as good as dock workers(stevedores) or longshoreman (operating engineer) guild would cover the senior members with a small stipend.😀
  18. Pat Foley

    Parallel Resampling of (VCL-) Bitmaps

    Hey, the only I know about Pix is the spanking received after burning a hole in Leica shutter curtain during an eclipse of the sun event. So would this SO help Daytime sunny color 6300 vs limelight and night shots? https://stackoverflow.com/questions/38876429/how-to-convert-from-rgb-values-to-color-temperature Then add entropy(S) Squished or Stripped and say 3/5 DOF Degrees of Liberty/Freedom to allow/justify different coefficients?
  19. Pat Foley

    %G equivalent in FormatFloat?

    That works for pH Scale. Closer range, scale and offset yields: procedure TForm21.Button1Click(Sender: TObject); const ZeroOffset = 7; var X: double; I: Integer; begin for I := -7 to 7 do begin X:= Power(10,I); Memo1.lines.add(Format('pH %d oh %G',[i + ZeroOffset,x])); end; end; (** pH 0 oh 1E-007 pH 1 oh 1E-006 pH 2 oh 1E-005 pH 3 oh 0.0001 pH 4 oh 0.001 pH 5 oh 0.01 pH 6 oh 0.1 pH 7 oh 1 pH 8 oh 10 pH 9 oh 100 pH 10 oh 1000 pH 11 oh 10000 pH 12 oh 100000 pH 13 oh 1000000 pH 14 oh 10000000 **)
  20. Pat Foley

    %G equivalent in FormatFloat?

    That's a good start! Say if you running a chemical treatment controller for million gallons of drinking water per day. You set the Chart scale at 0 to 10 parts per million and gpm scaled zero to 1000 gpm either by fitting to your scale or add axis as needed . Look at the graphs in white papers in the field you are working in to determine if part per million or part per billion. Note Engineering Unit is SI or in US USCS known to some as field units requiring additional scaling need.
  21. I made the assumption that my D1-7 custom controls were only 32 bit x86 so made all new controls for 64 bit x64 on D10.2 several years ago. (Naive and fear, uncertainty and dread caused by the marketing and not staying current. lately, I found some of the custom TGraphiccontrols actually work better on a touch screen and readily cast to TV with Bluetooth. (Albeit a new win11 machine) In 32 x86 The question is under D7 is there any warnings or hints as each library or package is compiled? The question is under D10 is there any warnings or hints as each library or package is compiled? In 32/64 x64 have dcu64 directories to prevent error 2048 found x86 wanting x64 before trying to compile 64*. use NativeInt vs integer for offsets if using pointers. after a build all check the dcu filedatetimes to verify all the code actually compiled. *In case the 64 compile ever needs to be recompiled.
  22. Put in a FlowPanel to make visual collection and Buttons are listed as FlowPanel.Controls. 🚋 Here's sample based on Cantu's 10.4 guide. Button renamed Karma operates two checkboxes with descriptive event handlers. Type TKarma = 0..10; const KarmaRatingCutoff = 7; //allow good Karma when good most of the time was 8 var Goody: Boolean = False; KarmaRange: TKarma = High(TKarma); KarmaNow: TKarma = 0; procedure TForm21.KarmaChange(Sender: TObject); begin Screen.Cursor := crAppStart; //calm the user with phone like spinner Karma.OnClick := nil; Bad.OnMouseDown := nil; Good.OnMouseDown := nil; //snuff the event handlers Karma.Enabled := False; Bad.Enabled := False; Good.Enabled := False; //prevent user input KarmaNow := Random(KarmaRange); Goody := KarmaNow > KarmaRatingCutoff; //direct assignment no ifs + Ranged to conserve the KarmaBase sleep(7); // Good.Checked := Goody; Bad.Checked := not Goody; if Goody then Karma.Hint := 'Yaa' else Karma.Hint := 'Yuch'; Karma.ShowHint := True; Screen.Cursor := crDefault; // Bad.OnMouseDown := BadmdEvent; // Good.OnMouseDown := GoodmouseEvent; restore one at a time to find bad actors Karma.onClick := KarmaChange; Karma.Enabled := True; end;
  23. So inside an application with many forms and Controls you could build a list of Controls addresses by searching by form name and then component name and use list later with getparentform is easy to bringtofront and show needed controls. Or realizing the list when custom controls or even standard controls are loaded at runtime.
  24. Pat Foley

    How do I execute code after FormShow ?

    deleted
  25. The dproj has a Guid assigned to it. It rhymes with Gui-de cheese most of the time. but when it used as interface* that once named can't be changed or need to be renamed if the Interface* is changed. If not then Guid rhymes with Squid. The question is when the project is not compiling--OK to just index the Projects Guid until the bad code is removed or repaired? I bumped the projects Guid 3 times to fix a boo-boo. But likely not a good practice to share. Or say some naive person like me lays out a blank project with its directory and sub directories laid out, then copies the layout to new directory for a new project, finds out later there's two projects with same Guid. *If is used as an Interface not just a marker. Pat Note seen an eye catcher at line 4689 in System.Classes Putting 4690 first would read better
×