

Pat Foley
Members-
Content Count
418 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Pat Foley
-
Delphi 12 - Breakpoint not work when use Rumtime Packages and Win64 platform
Pat Foley replied to giorgiobazzo's topic in Delphi IDE and APIs
uses Vcl.Forms, MyUnit, //From TrPartUnits.bpl, if remove, breakpoint works in win32 and win64 AppForm in 'AppForm.pas' {Form2}; {$R *.re Based on your info when the myunit is removed it compiles. Delphi 12 in debugger mode even with update often shows the dissembler first under a tab. To avoid compile the program and start the program using the browser in "attach to process" under the run button to start the executable and press f7-f9 buttons if hung up in the dissembler. If blue dots not lined up with the source check path.- 11 replies
-
- delphi 12
- rumtime packages
-
(and 2 more)
Tagged with:
-
Delphi 12 - Breakpoint not work when use Rumtime Packages and Win64 platform
Pat Foley replied to giorgiobazzo's topic in Delphi IDE and APIs
Reading between the lines means using a string for finding a form in runtime with the Screen. Or Each Library should just launch its own forms or class var singleton form as needed.- 11 replies
-
- delphi 12
- rumtime packages
-
(and 2 more)
Tagged with:
-
Delphi 12 - Breakpoint not work when use Rumtime Packages and Win64 platform
Pat Foley replied to giorgiobazzo's topic in Delphi IDE and APIs
program App; uses Vcl.Forms, MyUnit, //From TrPartUnits.bpl, if remove, breakpoint works in win32 and win64 = please don't put MyUnit here AppForm in 'AppForm.pas' {Form2}; {$R *.res} begin Application.Initialize; //Breakpoint here: on win32 is ok, but 64 the breakpoint dont stop! Application.MainFormOnTaskbar := True; Application.CreateForm(TForm2, Form2); Application.Run; end. If myunit is available in a library, it can't also be in the program's dpr. Access the Library myunit in each unit uses clause as needed! If the unit uses clause doesn't see myunit adjust the path. Putting my myunit in apps dpr will hide these issues and defeats the goodness of modular construction methods.- 11 replies
-
- delphi 12
- rumtime packages
-
(and 2 more)
Tagged with:
-
A gem from the past (Goto)
Pat Foley replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Here is a dangerous example of Goto causing endless loop you never finish this gamebook's first edition. In the gamebook You Can Be The Stainless Steel Rat by Harrison. There's an example of a typo goto 290 should be goto 190. https://stainlesssteelrat.fandom.com/wiki/You_Can_Be_The_Stainless_Steel_Rat -
I try to use EM units say roughly a font of 72 would be one inch high, on a laser printer of 600 dpi you get one inch high lettering. Using CSS you can set the sizing to show the ... when the ... rule is set. Somehow windows can make small images when hovering over an icon or medium size images in task view. What's neat the image is animated. Now I just right-size the form and use units of "fat-finger" on custom control resize events. This resize event helps on the 4k machines.
-
Say with periodic stuff like TDateTime Trunc works well if it understood that right now is yesterday date + 0.xxxx fraction so Trunc not supposed be rounding up to zero when negative. Conversely On the Unit circle a truncated 1/4 turn needs one turn added to get a "reading" of 1 Now to turn back that turn added, we remove that turn when looking at "negative values" (-1/4 - 1) = Trunc(-1.25) = -1.
-
Viewing All the Digits of Pi in Real Time with Delphi
Pat Foley replied to Jim McKeeth's topic in I made this
In you missed it Two Pie day or Tau June 28 is coming! https://tauday.com/tau-manifesto Article about using Tau in schools.- 1 reply
-
- pi
- bigintegers
-
(and 3 more)
Tagged with:
-
Why not put a break point in it and use the call stack to see who needs it since you found the unit. Or comment out half the enums or settings in it. If it's only a dcu--view in a text editor. The graph tool does have a build order output that could in help placing a breakpoint when compiling when unit is renamed.
-
Style sludge and shadow it's hard to know which window is showmodal. I like to move the cursor to control being surfaced to help end user know which window has focus. Windows is flashing the active window though the smoke to alert you pushing buttons on inactive window.
-
I don't want to change anything about other controls, I just need a control to be on top of all others. Here's putting the label on a tabsheet. This allows giving a context to incoming label. By using tabsheets in the IDE you can group controls readily Then show only what is needed in runtime. var ts: TTabsheet; var labelNu: Integer = 1; procedure TForm1.AddLabelwithTabbedIndexClick(Sender: TObject); begin ts:= TTabsheet.Create(Self); ts.PageControl := PageControl1; ts.Caption := LabelNu.ToString; var llabel := TLabel.Create(Self); //was TStaticText llabel.Name := 'llabel' + LabelNu.ToString; lLabel.Caption := 'label&' + LabelNu.ToString; lLabel.Parent := ts; //LLabel.TabStop := True; ts.TabVisible := True; Inc(labelNu); end; procedure TForm1.RandomShowHideTabClick(Sender: TObject); begin ts := PageControl1.Pages[Random(PageControl1.PageCount)]; with ts do TabVisible := not tabVisible; end; procedure TForm1.Showllabel1Click(Sender: TObject); begin var lbl := FindComponent('llabel1'); (lbl as TControl).show; end;
-
You could hide the pagecontrol to show the label parented to the form or change the label parent to control on top. I would use a Tpanel set to top align that "pushes" the Tabsheet/pagecontrol down to mimic the banners used in MS's XL when showing.
-
A Memory Game in Delphi
Pat Foley replied to LaryRose's topic in Algorithms, Data Structures and Class Design
To find what is not connected, use the debugger. Switch from the form view ~design tab to the code view and insert a breakpoint on a line that has a blue dot on it in left gutter. Using F5 will cover the blue with red dot if the project is in debug mode selected in manager. Test the Button click it should halt program at the program line selected. Test the DrawGrid ondraw event next. If the program doesn't break at the breakpoint, inspect if the Drawgrid1 event ondraw is assigned using the object inspector Events tag. -
Observations 12 Patch vs 11.3 12 eats inifile lines commented out using ; Unsure if the IDE or program made is doing it. 12 IDE editor tabs get resized just like GEx tabs when hot switching from 4K to low resolution. Suggesting that Style needs applied for high DPI to work. An executable with style seems to "right" size readily:)
-
Delphi and "Use only memory safe languages"
Pat Foley replied to Die Holländer's topic in General Help
Just a shake down by the government. Consider the Tik-Tok uproar last year. The Tik-Tok lobbyists silenced the talk by talking to the complainers and voila Tik-Tok is good. If you want your stuff used get a good lobbyist! -
Seeking Collaboration: Creating a Delphi Component for STM32 Boards
Pat Foley replied to techdesk's topic in General Help
Why not do it yourself. First build arduino project with openwire. https://blogs.embarcadero.com/control-and-communicate-with-arduino-device-in-this-innovative-software-built-in-delphi/ Then should be able to implement a project with your device and desired features. -
A native VCL, and not Windows-based, TComboBox control.
Pat Foley replied to shineworld's topic in VCL
Here is a sample of runtime created controls that use same string. Plus assigns event handler. const InputPLC256 = 'x0,x1,x32,pin64,pin128,pin255,None'; procedure TForm1.Button4Click(Sender: TObject); begin for var I := 1 to 100 do begin var P := TPanel.Create(Self); with P do begin Name := 'TagInputEdit_' + I.ToString; SetBounds(280 - 5, 17 + I * 34, 204, 30); Parent := Self; Caption := ''; end; var L := TLabel.Create(Self); with L do begin SetBounds(80, 6, 64, 22); Parent := P; end; var CB := TComboBox.Create(Self); with CB do begin SetBounds(5, 3, 65, 22); Parent := P; Show; onchange := TagUpdater; Tag := NativeInt(L); items.CommaText := InputPLC256;//memo1.Lines; Text := Items[Random(items.Count)-1]; L.Caption := Text; end; end; end; procedure TForm1.TagUpdater(Sender: Tobject); begin var S := Sender as TComboBox; var L := TLabel(S.Tag); var N := S.Parent.Name; L.Caption := Format('%s %s', [N, S.Text]); end; -
Try setting the TabStop property of Radiogroup to True when none of the controls are selected. In the RadioGroups.OnEnter set focus on a control so keys can change the selection as needed. //Need RG .TabStop prop set to True to 'focus' the groupbox when its control index //is -1; procedure TformInstructorStation.RadioGroup2Enter(Sender: TObject); begin with Sender as TRadioGroup do if ItemIndex = -1 then TRadioButton(Controls[0]).SetFocus; //(Sender as TRadioGroup).OnEnter := nil; end;
-
How about a collection of check boxes TCheckListBox The sample simply clears the checkboxes that were in the IDE and adds the ones that are in Array<string> To extend you would change the Panel and Tstrings that the UI uses update the backend. Here the back end simply updates the UI when programs are used. It uses a Ddd pattern Data driven pattern. " Update the data early and often" class function TptrApps.HookInUI(inSG: TStringGrid; inLog: TStrings; inChBxs: TcheckListBox; inBanner: TPanel): TptrApps; begin Result := nil; focusedApp := @cacheApp; var R := TptrApps.Create; R.ChBxs := inChBxs; R.ChBxs.OnClick := R.changeExesList; R.ChBxs.Items.Clear; for var I := Low(goodApps) to High(goodApps) do begin R.ChBxs.Items.add(goodApps[I]); R.ChBxs.Checked[I] := True; ... const selfClass = 'FrmPat'; GoodApps: Tarray<string> = [cEveryThing,'Shell_TrayWnd','Notepad', 'TAppBuilder', 'Window', 'Chrome_WidgetWin_1', 'Notepad++', selfClass, 'TfmPeInformation' ];
-
Data structure for Integer ranges
Pat Foley replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Or like the minesweeper game. Test for "open water" or "good ice". A test returns the position in range with start and stop of range when found and could return the size of the "open water" when not found. -
https://answers.microsoft.com/en-us/outlook_com/forum/all/how-to-insert-attachment-to-recurring-meeting/a418db48-337c-4124-8364-ea1344a13dee The employee needs to share calendar so you can look at it.
-
Outlook's contact info is a vcard file and calendar event is vcalendar *.vcs or *.ics file. The employee calendar shows the events provided by the calendars the employee has access to. Example of email attachment https://answers.microsoft.com/en-us/outlook_com/forum/all/how-to-insert-attachment-to-recurring-meeting You would simply add an event attachment to the email of employee. But better to educate the office staff how to use Outlook calendar by having the secretary set the events on the employee calendars as needed. Employee leave requests are sent to office manager. If approved the secretary amends the department's calendar which updates the employee calendar. The employee looks at the calendar events provided by the secretary. The secretary knows when the employee knows of a calendar event by the employee opening an email with a calendar event attachment and confirming the event.
-
Record operator overloading error
Pat Foley replied to lisichkin_alexander's topic in RTL and Delphi Object Pascal
Here's my 7 cents worth. 'Explicitly' use a's Value to remove need for braces. var a: TplFilterValue<Boolean>; B: Boolean; procedure //Boolean User output Bout (argS: string; aB: Boolean); begin writeln(argS + ' = ', aB); end; function NotFixup(aB: TplFilterValue<Boolean>): Boolean; begin Result := not aB.Value; end; begin try a.Value := True; //if not a then Bout('not a', not a); Bout('a or True', a or True); Bout('a and True', a and True); Writeln(' NotFixup'); //if not a or True then // <<--- Error [dcc32 Error] E2015 Operator not applicable to this operand type Bout('Notfixup(a) or True', NotFixup(a) or True); Bout('NotFixup(a or True)', NotFixup(a or True)); Writeln(' Precedence manual sort fix'); // Bout('True or not (a)', True or not (a)); Bout('True or not a', True or not a); Writeln(' not precedence working for boolean here'); B := a; Bout('not B or True', not B or True); a := not B or True; Writeln(' Or use a''''s Value explicitly :)'); Bout('not a.value or True', not a.value or True); readln; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. -
How can I force a record to be allocated on the heap ?
Pat Foley replied to dormky's topic in Algorithms, Data Structures and Class Design
// Define a record type as a data class data class cpRecord( var UI: TStringGrid, // Assuming this is a custom type var compute: TProc, // Assuming this is a functional type var Value: PDouble // Assuming this is a pointer type ) // Define a custom generic list as a subclass of MutableList class TcustomList : MutableList<cpRecord> { // Delegate the implementation to an ArrayList private val list = ArrayList<cpRecord>() // Implement the abstract methods of MutableList override val size: Int get() = list.size ... I think "port"able coding should be what is taught. Starting with Excel. Above code from a "Bing" prompt porting a Delphi TList<PRecord> to Kotlin. The "Precords" allow more shallow code on D jobs and should allow a port on the Android side. In the past one could simply use JS.evaluate(some script). -
Here is a sample using a ColorDialog and ListBox. Note In the IDE you can interact with the colordialog on the form to preload custom colors. The ColorDialog can be to show full with in object inspector. procedure TForm1.Button1Click(Sender: TObject); begin If ColorDialog1.Execute Then Listbox1.Items := ColorDialog1.CustomColors; end; procedure TForm1.ListBox1Click(Sender: TObject); begin if Sender is TListBox then begin var lb := TListBox(Sender); var I := lb.ItemIndex; Color := StrtoInt('$' + lb .Items .ValueFromIndex[I] ); end; end;