-
Content Count
222 -
Joined
-
Last visited
-
Days Won
9
Posts posted by SwiftExpat
-
-
I think what you are looking for is this, declare a var to the type of the event.
procedure TfrmRTCaddie.LicenseEditRefresh(const AValid: boolean; AInvalidReason: string); var ne: TNotifyEvent; //variable of event type begin ne := edtLicKeyCode.OnChange; //set the variable to the current onchagne edtLicKeyCode.OnChange := nil; //set on change to nil //work goes here edtLicKeyCode.OnChange := ne; //asign the event hander back to the control event end;
-
2 hours ago, David Heffernan said:I wonder, how would a language exception raised by another module in your process appear as when it reach your exception handler?
I believe this is what your asking for, something like this, focused on the else clause, adjusted for the faulting module.
"You can access the current except value via JSExceptValue in unit JS."
"Note that this is only valid inside the catch-block. The compiler will not warn, if you use it outside. "
Unit MyModule; Interface Uses SysUtils, Math, JS; Function DoIt(n: integer): double; Implementation Function DoIt(n: integer): double; var E: Exception; Begin try Result:=double(7.0)/n; if not IsFinite(Result) then if n=0 then raise EZeroDivide.Create else raise EOverflow.Create; except on EZeroDivide do Result:=0.0; on E2: EOverflow do Result:=0.0; else raise EAbort.Create('Something other: '+String(JS.JSExceptObject)); end; End; End.
Reference : https://wiki.freepascal.org/Pas2js_Transpiler#Translating_try..except
-
You could try to write the except statement with the else syntax to see if it gets caught. I had to do this in web core, null items will raise an exception that are a special exception.
try ... except on E: Exception do Logger.Warn('Failed app tool init : ' + E.Message, self); else // handle everything else Logger.Warn('Failed app tool init', self); end;
- 4
-
3 hours ago, Patrick PREMARTIN said:but beta testers (like me) can't check everything except projects we work on
Agreed.
5 hours ago, Lars Fosdal said:There also seems to be developers that write code that really is sub par, but no process that corrects it.
That process is QP defects, but it is too late in the game. That is not fair to the developer (and should be planned for).
As a beta tester I am testing with only a small time allocation, 1-2 hours per week. From my point of view, some focus to the beta cycle should be added to get the most out of beta testers. Establish coverage by dividing up focus groups by feature:
- Allow me to choose 2-5 features I use in the IDE
- Assign 1-2 features I use rarely but am familiar with
-
Not related to ICS, but sounds like a problem I had in the past. Disable flowcontrol on the ethernet adapter.
-
I use this, you should be able to adapt for your use. RootComponent is a TForm.
Reference:
function TSERTTKRepoForm.ScreenShot: TTMSFNCBitmap; var lms: TMemoryStream; bmp: TBitmap; fScreenScale: Single; Surf: TBitmapSurface; function GetScreenScale: Single; var ScreenService: IFMXScreenService; begin result := 1; if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, IInterface(ScreenService)) then begin result := ScreenService.GetScreenScale; end; end; begin lms := TMemoryStream.Create; try lms.position := 0; fScreenScale := GetScreenScale; bmp := TBitmap.Create(Round(TForm(RootComponent).Canvas.Width * fScreenScale), Round(TForm(RootComponent).Canvas.Height * fScreenScale)); bmp.Clear(0); if bmp.Canvas.BeginScene then try TForm(RootComponent).PaintTo(bmp.Canvas); finally bmp.Canvas.EndScene; end; Surf := TBitmapSurface.Create; Surf.Assign(bmp); if not TBitmapCodecManager.SaveToStream(lms, Surf, '.png') then raise EBitmapSavingFailed.Create('Error saving Bitmap to png'); Surf.Free; bmp.Free; lms.position := 0; result := TTMSFNCBitmap.CreateFromStream(lms); finally lms.Free; end; end;
- 1
- 1
-
TMS has this, should almost fit your needs.
https://download.tmssoftware.com/doc/tmsfncuipack/components/ttmsfnctableview/
-
I think you are missed the pth file, review the steps in this answer and double check:
https://stackoverflow.com/a/48906746
-
Willi,
The behavior is expected if your code is hung, the IDE does not actually clean up the process. I wrote an IDE expert, but it is only for Delphi 10.3, 10.4 & 11.
You can create a tool in the IDE to make killing the process simpler, see this thread, page 4 look for taskkill and then set the correct exe name to cleanup your project.
-
-
1 hour ago, Juan C.Cilleruelo said:a "correct" form of doing this?
I will add a requirement that you want a stable deployment to test against, so that you can certify your software and have a basic support level matrix.
I selected python embedded, so I know my python version is 3.9.x. I then PIP installed the modules so the version of each module is known and can be tested to work.
I then zip all of that up and deploy it as a sub-directory to my executable.
Correct depends on what you believe you can support on the client system.
-
This should get you started, I match mine by classtype.
for i := 0 to Screen.FormCount - 1 do // itterate the screens if Screen.Forms[i].ClassType = TSERTTKMarshalForm then begin Screen.Forms[i].Show; if Screen.Forms[i].WindowState = TWindowState.wsMinimized then Screen.Forms[i].WindowState := TWindowState.wsNormal; exit; end;
-
19 hours ago, David Heffernan said:This code is wrong
I think I get you point, would you write it like this?
edited above based on feeback
-
Likely just call CoInitialize
CoInitialize(nil); try ... your code here finally CoUninitialize(); end;
-
Someone had a similar question in the TMS forum recently and I thought the work around was a quick solution.
Add columns (the work around was to hide the columns) to the tree view for each piece of data that is in your pointer. When you assign the pointer, copy the strings to the text of the columns.
The TMSFNCTreeView in FNC UI Pack is JSON based, you can see if it fits your needs.
-
6 hours ago, H05 said:a problem for tomorrow
This can be frustrating to understand, because technically your code works.
4 hours ago, David Heffernan said:I think it's far more likely to be environment variables being inherited.
The comment above is right on point, your next step in isolating this should really be using SysInternals Process Explorer and use the Environment tab to examine the environment variables. Compare the run from the IDE and from Windows explorer and then you know, based on the difference, what to set and what gets set from the IDE.
- 1
-
Are you running the application from the IDE, either run or debug?
Close the IDE and then run your executable, it will likely work.
- 1
-
Runtime resources are limited, join us tomorrow to learn about Marshal.
See you on Tuesday Nov 15.
https://www.tmssoftware.com/site/tmswebacademy.asp?id=145
Preview the content via the videos above to see how this will be a beneficial webinar for you.
-
Space is still available !! Take a sneak peek at the content with the videos above.
See you on Tuesday Nov 15.
https://www.tmssoftware.com/site/tmswebacademy.asp?id=145
-
Just another tool for an age old problem, PowerToys now has an option to find what process is locking a file and option to kill the offender.
My source was Ghacks (RSS feed):
https://www.ghacks.net/2022/11/03/powertoys-0-64-launches-with-file-locksmith-and-hosts-file-editor/
Official site:
https://github.com/microsoft/PowerToys/releases/tag/v0.64.0
-
RunTime ToolKit Marshal version 2022.11.02 is available.
New Features:
Custom Inspectors can now be written based on class type. Sample for a TMS FNC Chart here Custom Inspector FNC Chart: https://github.com/SwiftExpat/RunTime-ToolKit/tree/main/Samples/FNCChart
App Inspector component(non-visual) automatically starts Marshal and allows to re-open inspectors from last session.
Object Plus now allows inspection of sub-components.Behavior change:
Component properties that are components now open/switch to an inspector instead of an inline edit.Fixes:
Frames correctly nested/expanded in navigation tree.Full release notes: https://swiftexpat.com/marshal/version.html
Compiled demo for FMX and VCL here: https://github.com/SwiftExpat/RunTime-ToolKit/releases/tag/2022.11.02
Live webinar on Nov 15, 2022 will demonstrate the new custom inspector, signup here: https://www.tmssoftware.com/site/tmswebacademy.asp?id=145
Choose your level and see Marshal in action:
Basic - Object Inspection:
https://www.tmssoftware.com/site/blog.asp?post=1005
Intermediate - Data Inspection:
https://www.tmssoftware.com/site/blog.asp?post=1008
Advanced - Custom Inspector for FNC Chart:
https://www.tmssoftware.com/site/blog.asp?post=1014Any questions or feedback feel free to:
- comment on this post
- send me a message
- comment on Github
- comment on YouTube
- send an email
- and this list could be longer but should be enough to put a laugh in your day
-
Sounds like you want RRDTool, at least from a structure / consolidation function perspective.
-
Visual Impact part 3 of 3 is available in the TMS blog and resumes with the story: Your presentation begins in 8 minutes and the dashboard can be enhanced using data labels on the chart. Marshal custom inspectors allow you to author your own inspector and shown is a custom inspector for a TMS FNC Chart.
See the post here:Blog 3 of 3 Visual Impact
On Nov 15, 2022 I will be presenting in a live webinar with TMS to show how Marshal can be used to solve some last minute issues with this dashboard and ensure a successful presentation.
Register for the webinar: Webinar RegistrationVideo summary:
The compiled demo apps and source code are available here with a brief explanation about how they are built.
https://github.com/SwiftExpat/RunTime-ToolKit/tree/main/Samples/FNCChart
Please sign up for the webinar and join us to explore how Marshal extends your debugging options at runtime.
I do appreciate feedback either here, GitHub, LinkedIn or email.
-
Anaconda shows to be 64 bit, what platform are you targeting in Delphi?
Is it possible that an exception does not inherits from Exception class?
in RTL and Delphi Object Pascal
Posted
I did not blanket re-write my handlers. I started from the top down combined with refactoring.
From a debugger session point of view, it gives you a place to set a break point. That means you have to set 2 breakpoints.