Jump to content

Pat Foley

Members
  • Content Count

    439
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Pat Foley

  1. Pat Foley

    Debug Points won't clear

    Use the Finder typing Debug should yield view breakpoints.
  2. 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
  3. 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
  4. 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.
  5. 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.
  6. 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;
  7. 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.
  8. 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.
  9. 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.
  10. Pat Foley

    debugging crash

    I did have a crash when setting 64-bit debug to release on d11.1. And some wrecks running 10.4 in same time frame when switching over. To fix that mess I switched to 32 bit and hit compile all projects and also may have overwritten a .dproj or two by starting up with .dpr to get fresh dproj. I plan inspect the dcus freshness next time! 32==>64 is OK but 64==>32 may not have worked well on 10.4. On 11 64 debug ==> 64 release the custom components in Palette were dimmed when unable to load.
  11. Pat Foley

    Lost Code Format Menu option....

    Try using the finder(s) first type format in Title bar finder finds Options under tools then type formatter in options title bar.
  12. Pat Foley

    debugging crash

    First set a break point or hit F7 or F8 before running F9 that either key should run to cursor last position. It may be keys are remapped to Alt - F4 somehow.
  13. Pat Foley

    Windows Dayligthsaving problem

    I seen a scheme where the file is name like this to allow futureorders dir and settledorders dir sorting. Purchaseorder.vendor.20220115.xls Add NTFS partition to flash drive or new drive
  14. Pat Foley

    Loading data from dfm

    I suspect the root cause is one needs to override the virtual method with override then the inherited can be commented out or moved as needed.
  15. Pat Foley

    Tstringgrid grid index out of bounds

    Couple of things that might help with the port is That coding would yield where the cursor or record pointer is if a flat file? Renaming Field Name 'c' to align to what stored in it. Then Colcount would renamed to align to whats begin returned. I suspect its layout number. There is a columns count or fields count plus records count for each table. I think that older codebase should considered in final trim. Any improvements don't touch vintage code. If you're using 10.x program the improvements to suit that vintage. Over time d5 vintage code is not used very much. Good luck comes from months of careful planning and testing of enlightened repairs or good maintenance. Making a procedure in the DataModule that populates the VCL Control passed to it that can used any form that uses DMxx; the DMxx would only need VCL.grids added to the uses clause not needing the form calling it adding to uses clause. DM Public procedure getDataforSG(aCDS, aCDS2: TClientDataSet; rangeLeft, rangeRight, rangeTop, rangeBottom: Integer; aFieldName: string; //... aSG: TStringGRid); ... implementation procedure TDM.getDataforSG(aCDS, aCDS2: TClientDataSet; rangeLeft, rangeRight, rangeTop, rangeBottom: Integer; aFieldName: string; aSG: TStringGRid); var I,J: integer; RackID: Integer; TubIDcol: Integer;//Variant; csvfieldNames: string; fishName: string; begin aSG.Rows[0].CommaText := 'row'+ aFieldName; if rangeRight > CDS.FieldCount then rangeRight := CDS.FieldCount; if rangeBottom > CDS.RecordCount then rangeBottom:= CDS.recordCount; aSG.ColCount := rangeRight-rangeLeft; aSG.RowCount := -rangeBottom-rangeTop; //To find what c is about //pass in aFieldName := 'c'; for I := rangeTop to rangeBottom do begin aCDS.RecNo := I; fishName := ACDS.FieldByName(aFieldName).AsString; ASG.Rows[I].CommaText := aFieldName + ',' + fishName; end; //build SL header for I := rangeLeft to rangeRight do begin csvfieldNames := csvfieldNames + CDS.Fields[I].Name + ',' end; ASG.Rows[0].CommaText := ('Row,' + csvfieldNames); //Put your tubCDS code here Insert into form procedure Tmain.buildrackClick(Sender: TObject); const MagicNumberUp = 1; MagicNumberDown = -1;// would need inserted to adjust SG row offset var c, r, box : Integer; RackId : string; begin //ShowMessage('draw grid'); //setgridrow := -1; //setgridcol := -1; //box := 0; //RackId := ListBox1.Items[ListBox1.ItemIndex]; RackId := 'c'; getDataforSG(ffdata,tubdata,0 +MagicNumberUp,50000,0+MagicNumberUp,50000,RackID,StringGrid1); //(** comment rest out for now **)
  16. You missed the name of program interSector.dir It calls the chips intersector routine look at the disassembly. The only documentation I have found is this. VP2INTERSECT I done a lot of spreadsheets using just formulas over the years... Excel Range("A1:A10").Select 'Selects cells A1 to A10. Range(Range("A1"), Range("A10")).Select 'Selects cells A1 to A10. Range("A1, A10").Select 'Selects cells A1 and A10. Union(Range("A1"), Range("A10")).Select 'Selects cells A1 and A10. Range("A1:A5 A5:A10").Select 'Selects cell A5. Intersect(Range("A1:A5"), Range("A5:A10")).Select 'Selects cell A5. Delphi's DB and graphics have similar functions. TList<T> has range! Pat
  17. Pat Foley

    INI problem

    Consider MemInifile.setStrings(SL) I use it for Demos. Using it seems to reduce waking the Antimal. const Brand = 'PF'; const wrappedBrand = '\'+Brand+'\'; var IniNotFound: Boolean; var BrandNotfound: BooLean; var iniDir := Tpath.GetPublicPath; var AppHappyName := Application.Title; //following yielded /appdata/Roaming //PathedIniFile := System.SysUtils.GetHomePath + Application.Title + '.Ini'; var PathedIniFileName := iniDir + wrappedBrand + AppHappyName + '.Ini'; IniNotFound := not fileexists(PathedIniFileName); BrandNotfound := not DirectoryExists(iniDir + '\' + Brand); if BrandNotfound then ForceDirectories(iniDir + '\' + Brand); InidataFile := Tmeminifile.Create(PathedIniFileName); if IniNotFound then begin var SL: TStringList; SL := TStringList.Create; try SL.Text := cDefaultIni; IniDataFile.SetStrings(SL); IniDataFile.UpdateFile; // comment out for Demo finally SL.Free; end; end;
  18. Pat Foley

    Incompatible types bug in D11.1

    How to name Consider numerous Excel users that do not name the ranges. Naming allows the formulas to be readable and robust. In excel a name could refer to the cell that a spin control is assigned to. In Delphi the default naming scheme reflects what control or control property we are using. Knowing what slows down many XL users, one could change the arguments passed to fit the names of what is wanted or needed. procedure TfrmViewMain.MoveShapeItem(Value: TPanel; AStepDelay: Integer = 100); //Value should only used inside a TComponent in Property.setter IMHO //reflect name of thing wanted. procedure TfrmViewMain.MoveShapeItem(Panel: TPanel; AStepDelay: Integer = 100); // a good start procedure TfrmViewMain.MoveShapeItem(MovetoRight, LeftFence: TControl; AStepDelay: Integer = 100); //or may be a little much procedure TfrmViewMain.MoveShapeItem(var MovetoRight.Left, LeftFence.Left:Integer; AStepDelay: Integer = 100); //for intent use Control-J summary template to roll your poppy. //for errors look at left view mirroe in Structure
  19. Pat Foley

    Incompatible types bug in D11.1

    Look at Line 63
  20. My frontal lobe Latency is one-two minutes L1 cache. one to two weeks L2 cache every else is water under the bridge. excepting a few grudges. 🙂
  21. I learned alot from Mike questions and answers. Here's my stab at it. program interSector; {$APPTYPE CONSOLE} {$R *.res} {$o+} uses System.SysUtils, System.Diagnostics, Classes; type // TsetOPs = (EditStr, ButtonStr, CheckStr, FormStr, FrameStr, ListBoxStr, PageControlStr, TabControlStr, RadioBtnStr, ComboBoxStr); TdbKey = (dateID, sqlID, CashID, EditID, ButtonID, CheckID, FormID, FrameID, ListBoxID, PageControlID, TabControlID, RadioBtnID, ComboBoxID); // : integer; TsetKeys = set of TdbKey; const cLoop = 100000000; cSet: TsetKeys = [dateID, CheckID, FrameID, ComboBoxID]; var vSW: TStopwatch; vBool: boolean; procedure IsIntersected(const aID: integer; var aB: boolean); inline var Intersected: TsetKeys; Op: TdbKey; begin Intersected := [CheckID, FrameID, ButtonID] * cSet; aB := aB or (Intersected <> []); //for OPs in Intersected do to build relational DB end; begin vBool := false; vSW := TStopwatch.StartNew; var I: CppULongInt := 0; while I < cLoop do begin Inc(I); IsIntersected(I, vBool); end; Writeln(Format('IsIntersect = %5s', [vSW.ElapsedMilliseconds.ToString])); vBool := not vBool; readln; end. interSector.dpr.44: IsInterSected(I,VBool); 000000000052B51F 89C1 mov ecx,eax 000000000052B521 85C9 test ecx,ecx 000000000052B523 7D05 jnl interSector + $6A 000000000052B525 E8A611EEFF call @BoundErr 000000000052B52A 480FB70D1E010000 movzx rcx,word ptr [rel $0000011e] 000000000052B532 66230D035B0200 and cx,[rel $00025b03] 000000000052B539 803D5831030000 cmp byte ptr [rel $00033158],$00 000000000052B540 750D jnz interSector + $8F 000000000052B542 663B0D09010000 cmp cx,[rel $00000109] 000000000052B549 7504 jnz interSector + $8F 000000000052B54B 33C9 xor ecx,ecx 000000000052B54D EB02 jmp interSector + $91 000000000052B54F B101 mov cl,$01 000000000052B551 880D41310300 mov [rel $00033141],cl interSector.dpr.41: while I < cLoop do 000000000052B557 81F800E1F505 cmp eax,$05f5e100 000000000052B55D 72B6 jb interSector + $55 000000000052B55F 90 nop
  22. Pat Foley

    Dynamic creation of TActionManager with Actions

    Use ActionManager as in design window and its property editors and sub editors adding stubs to be used like this to connect the events at runtime. procedure TForm1.Button2Click(Sender: TObject); const popupmenuitemCaptions: array[0..1] of String=('Action4','frameAction1'); var popupFrameCaption: string; I: Integer; A: TContainedAction; begin for popupFrameCaption in popupmenuitemCaptions do for I := 0 to ActionManager1.ActionCount - 1 do begin A := ActionManager1.Actions[I]; if A.caption = popupFrameCaption then begin A.OnExecute := Frame11.PopupActionBar1.Items[0].OnClick; A.Execute; Break; end; end; end; object ActionManager1: TActionManager ActionBars = < item Items.CaptionOptions = coAll Items = <> ActionBar = ActionToolBar3 end> LinkedActionLists = < item Caption = '(No Name)' end> Images = ImageList1 Left = 722 Top = 172 StyleName = 'Platform Default' object Action4: TAction Category = 'Frame' Caption = 'Action4' ImageIndex = 1 OnExecute = Action4Execute end object DatasetFirst1: TDataSetFirst Category = 'Dataset' Caption = '&First' Hint = 'First' ImageIndex = 0 end end Inspecting the object in design by copying it to notepad shows Images property to possibly set at runtime.
  23. Pat Foley

    Build a Windows GUI shell in Delphi (CarPC)?

    It would be easier to duct tape an iPad over the airbag and run the speakers thru blue tooth. Second way. third item. https://www.makeuseof.com/tag/projects-raspberry-pi-touchscreen-display/ Third way. Delphi has a location demo for phone that works and ties into google maps. covers the map software. 25% of project would done. Works on my present android phone. Four. Finding screen size. https://stackoverflow.com/questions/1424920/how-do-i-get-the-usable-coordinates-of-the-screen-in-delphi to get the feel of embedded system Use the Task Manager to shut down Win Explorer. You can restart from Task Manager using new task Explorer.
  24. Pat Foley

    Window /client size bug in 10.4

    Actually Marco's post is between D11 to D10.4 PE flags updated to 6 to allow thinner borders and more margin. Try Autosizing False and Center True. To center image on form set align = alClient. That allows changing images readily.
  25. Pat Foley

    Window /client size bug in 10.4

    If you stored the image in the image control. Try this in 10.4 Select Image in Design window. Bring up the Picture editor F11 for object inspector and click on ellipses ... In the Picture editor save image as some thing else plus extension what it was.( .bmp .ping) view the image with other app. Other wise just delete the image control and install fresh one.
×