Jump to content

Pat Foley

Members
  • Content Count

    403
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Pat Foley

  1. Pat Foley

    Newbee: FMX: Can't find DirectoryListBox or FileListBox

    Best to leave that D5 code behind. FMX code can be earned by running the example samples for FMX. The FMX code has an OpenDialog component that might give you start.
  2. Pat Foley

    ListView Items additions

    Be sure View is report Here's 11.1 vintage clues on a project I am working on Allistair has a video on strUtils that showed similar stuff. procedure TForm3.Button3Click(Sender: TObject); var tvCol: TListColumn; Vi: TListView; li: TListItem; begin var SL := TStringList.Create; var ctL := TStringList.Create; SL.LoadFromFile('Logger11.csv'); LV.Clear; for var R := 0 to SL.Count - 1 do begin ctL.CommaText := SL.Strings[R]; if R = 0 then for var K := 0 to ctL.Count - 1 do begin tvCol := LV.Columns.add; tvCol.Caption := ctL[K]; tvCol.Width := 120; end else begin li := LV.items.add; li.Caption := ctL[0]; ctL.Delete(0); li.SubItems.CommaText := (ctL.CommaText); end; end; SL.Free; ctL.Free; end;
  3. Pat Foley

    Missing CommandText property

    could be tablename or stored procedure. Source https://docwiki.embarcadero.com/Libraries/Alexandria/en/Datasnap.DBClient.TCustomClientDataSet.CommandText
  4. Pat Foley

    Delphi or Lazarus/Free Pascal

    "No one ever got fired" for buying IBM was an adage from 80's when trying to sell a local solution. I spent most of my life operating machines at small power plant. Only during blackouts operators discussed restart. Otherwise it was being a snipe (swiper of bilge tanks) on Navy flagship. I was able to get "insight" into how the thing worked by using excel models. Later I developed an EAP not Employee Assistance Program but an Emergency Action Plan when at beginning of each shift discussing the actions to do when something happened to avoid blackout or injury. Which didn't sell to Manager who mentioned "many operators uncomfortable running in manual." I been working on generic simulator, using Delphi coding to build app with scenarios passing on how to handle events system wide or locally. The Delphi maintenance fee is like buying insurance to keep the language current to new advances and maintain good will by promoting Delphi. I am thinking to buy TMS web core and try on both D and L MSEdge has some tools to help Lazarus JSscript builds. This is debugging the Asyncdemo in Lazarus pastojs/Demos. Invoked by simply right clicking in browser F12 helps.
  5. Pat Foley

    Variable Hints

    The idea is code in English, then use Tool tip comment in local dialect as mnemonic. /// <summary> /// ateB + aplA = ammaG /// </summary> procedure TForm18.AddABtoC; begin var a := 1; var b := 2; var c := -1; c := a + b; end;
  6. Would going up to TCustomPanel help in changing the default? Otherwise blame it on styles
  7. Pat Foley

    How to force update to label during a loop

    The UI needs to communicate that the program is computing or updating... In the past the mouse cursor was changed to hour glass and spinner is used in Android. MS XL and Edge use spinners why wouldn't you? The following completes the for..loop emulation and set timer1.interval to 200. // if FthinkerIndex = 0 then // with timer1 do Enabled := not Enabled; the Example needed a button click to break out of loop.
  8. Pat Foley

    How to force update to label during a loop

    The timer events allow the UI to update. The for loop cannot without Application.Processmessages inside the loop. Plus using a sleep is a reason not to use a loop.
  9. Pat Foley

    How to force update to label during a loop

    Better to work with the controls than forcing them. Here's a code using a timer to update UI plus a way to stop the updating if needed. procedure TBaaSToDoList.Button4Click(Sender: TObject); begin Inc(FthinkerIndex); FthinkerIndex := FthinkerIndex mod 11; label1.Text := 'Thinking about ' + FthinkerIndex.tostring; //looking at which control sent message if Sender is TButton then with timer1 do Enabled := not Enabled; end; procedure TBaaSToDoList.Timer1Timer(Sender: TObject); begin Button4Click(Timer1); //or call with your thread end; private FthinkerIndex: Integer;// and in create set to zero
  10. Pat Foley

    Form closing - curiosity question..

    I am saying to use FormCloseQuery in the MainForm and not code any FormClose. Any Freeing is done in a FormDestroy. Avoiding the need for troublesome ScreenForm OnClose iteration.
  11. Pat Foley

    Form closing - curiosity question..

    The order of Screen.Forms is last used so you could use downto to avoid the active form at forms[0]. By setting the forms owner to application when creating and only coding FormCloseQuery when necessary allows no need to code the close event of each form. Pat
  12. Pat Foley

    Show the ancestors for a class?

    You would need the source code procedure TmainForm.RzButton1Click(Sender: TObject); var ClassRef: TClass; S,sS: string; begin ClassRef := Sender.ClassType; repeat sS := ClassRef.ClassName; S := S + #13#10 + sS; ClassRef := ClassREf.ClassParent; until (sS = 'TObject'); ShowMessage(S); end; to drill in. Else try this.
  13. These show my idea of controllers. Each controller is the dashboard of it's controlled domain. Better example would be a spinbutton changing a calendar view to start each week on say Sunday verses Monday. Another spinbutton changes the month the calendar view is looking at. The hours worked and leave taken each day is retrieved from DB. This Viewer was made to show a vendor that there was too much "separation of concerns" when they put vacation leave on one view and hours worked on another view. Viewer example loaded leave and hours worked on same view so adjusting for a consistent 40 hours each week when mixing benefits with hours worked was much easier. In time the vendor merged the views. Rather than actions or using TApplicationEvents. I make the DM UI aware by adding Forms and Controls to its user cause. When the application forms are created, editboxes, labels and panels are added to lists in the Event module. Note the mainform or other forms are not added to uses clause. The controls added in EM Eventmodule parent is set to panel or form passed in. but control onevent is direct consumed by the model. That makes it easier to debug IMHO. constructor TEventBoss.Create(AOwner: TComponent); begin inherited; Headings := TStringList.Create; Panels := TList<Tpanel>.create; //so controls can be added at run time Jobs := Tlist<TProc>.create; //needs empty parens to work Job() Edits := TList<TtextPair>.create; //TtextPair = Tpair<Tcomponent, Tcomponent>; Jobs.add(checkforWhiteSpace); //in the Edits list only states white space does not "change" //the value.
  14. Invert the scheme have the controllers on top and have them carry their own forms for additional display or tuning. Just set the properties the controller "looks at," drop on a form and use.
  15. Pat Foley

    "Fatal: F2048 Bad unit format" error in Delphi 10 Seattle

    Typing where dcc*.exe at the command line shows all Delphi pathed. only 10.4 and 11 pathed on my machine. I wonder why Delphi needs the system path set, wouldn't the registry be more modern pathing?
  16. Pat Foley

    Debug Points won't clear

    Use the Finder typing Debug should yield view breakpoints.
  17. Use the Rs to help. Records aRRays of Record // Reuse records by Repeat or iteRate Report the UI showing the data -additional Array[0..8*4] of TFrame //later -Input First build an app with a Stringgrid.Row[iteRater].commatext := Format('%d , %d ... [data[1],data[2]]) // convert what you have into csv format. Reduce -In Design window assign the same event to Controls calling the same procedure. Or assign event when loading UI controls at runtime. Use a Reference in that procedure - UpdateMatch(AGame: TMatch; Sender as TWinControl.Tag; Regulate the UI showing the data against time -Future matches use LeftTeam, RightTeam assigned Record with Nation string set to 'to be determined' -When the game is history the match.LeftTeam is assigned the team Use records using keys and several tables using these keys. TTeam = Record TLA, //Key Nation: string; Bracket end; TMatch = Record GMT,LocalTime: TDateTime; LeftTeam, RightTeam: TTeam; Keyed to a team or initial value end; TGamePlay = Record Game: TMatch; Keyed Team: TTeam; Keyed Yellows, Reds, Fouls: Integer; end; I would start with two hours reviewing the baseball code shared by Ray Konopka. https://delphibydesign.com/downloads/ DelphiGenerics.zip Pat
  18. Pat Foley

    Set focus on dialog box button

    Since you are working with Delphi now. There's a lot to learn about how get Delphi to speak to the Oracle or least a database. One step is learning about TDataModule. They're used in some examples. The quote has a button click inside a double click which is inside a dialog. How about enabling controls when needed. Hiding buttons are bad, better to have disabled buttons as placeholders with hints what is needed first. Pat
  19. Pat Foley

    Calculation problem

    Here's idea make a Tlist<TQuadbeam> to help separate the UI from the math. I marked up the UI to help.
  20. Pat Foley

    10.4.2 IDE crashes on start

    Sorry the tips didn't work. The 11.1 works very well on my laptop as did 10.4.1 and 10.3. Each one is always an improvement. Does the app made on Seattle machine run on the laptop that may check if the anti-virus and Access like what you are doing. The tip about loading the form in runtime is to allow not loading the suspect form dfm into design window. just have in same directory. Sometimes the IDE's browsing path gets out of sync with the compiler path.
  21. Pat Foley

    10.4.2 IDE crashes on start

    Try this in the new test project put in the code units and dfms that are not loading yet. you are already 3/8 done. This may find path error caused by code squished into small laptop. 🙂 implementation uses frmMemUnit;// put not in dpr or project var frmMemoTest: TffrmMemo; frmMainTester.btnClick(Sender: TObject); begin frmMemoTest:= TffrmMemo.create(application); // set break here or memoforms.create; frmmemoTest.Show; end;
  22. Pat Foley

    10.4.2 IDE crashes on start

    You could try this: Open new app and open a unit of the code hanging the IDE. The IDE code window draws red squiggly and warning mark where the defects are. If the units DFM is flawed that should turn up. Or top down approach is start the project with projx.dpr not projx.dproj. In case they are out of step.
  23. Pat Foley

    difference .optset and .dproj file

    A projectgroup may what what you want. Best to keep it all multi-device FMX switching the target platform in the project manager.
  24. Reading between the lines means learning actuarial science as side effect you learn how use various tools perhaps getting tools paid for as intern. The time spent porting would be better used becoming a Subject Matter Expert that way you know if the output is reasonable or just pretty.
×