Posts

Showing posts with the label Delphi Developers: Delphi Code Rants

Respected development company: Canvas throws exceptions

Respected development company: Canvas throws exceptions For Arc(), ArcTo(), AngleArc(), Chord(), Pie(), PolyBezier(), PolyBezierTo(). CopyRect(), and BrushCopy() totally fail. Support Reply (from the owner): "Yeah, we know bout that" "We can't implement all APIs." There is a big difference between "can't" and "won't". Converting Windows GDI calls is not rocket science. I know that. I have been it for 33 or so years (since the Windows 0.8 beta - 1986 ish?) Forwarding a GDI bezier to some other API is total child's play. Seriously, you have three points to send (and perhaps the previous point). Almost ever display driver has a bezier function. PolyBezier is just sending multiple Bezier curves. No Bezier function? Use another kind of spine. No other kind of Spine? Use a polygon. No polygon? Use lines. No Lines, use pixels, no pixels? OK, thats workable, send ASCII art. Point is, the support reply was total bullsh*t. They may not be ...

Seriously... The IDE can't do better than this??

Image
Seriously... The IDE can't do better than this??

Ugly code of the day that I found...

Ugly code of the day that I found... IOTAGalleryCategoryManager(BorlandIDEServices as IOTAGalleryCategoryManager).AddCategory(IOTAGalleryCategoryManager(BorlandIDEServices as IOTAGalleryCategoryManager).FindCategory(sCategoryDelphiNew), .....

I have Delphi XE and an old license of AnyDAC. I thought to make an experiment of using Community Edition and AnyDAC so I can have remote database access.

I have Delphi XE and an old license of AnyDAC. I thought to make an experiment of using Community Edition and AnyDAC so I can have remote database access. It didn't went too well. I managed to compile AnyDAC and even got my old application compiling in Tokyo, but AnyDAC fails to get data. I found out that in Data.DB line 6529 the member variable FIOBuffer is all zeroes so it doesn't get any data back. Anyways, I'm mostly ranting, but if anybody has any tips I'm all ears.

Is there a checklist online to debug autocompletion, errorinsight, or perhaps some tools to help the issue?

Is there a checklist online to debug autocompletion, errorinsight, or perhaps some tools to help the issue? It stopped working on my delphi Berlin project and I cannot seem to get it working. Perhaps I'm missing some toggles. I (think) it stopped working when I added a number of var x: TypeX; y: TypeQ absolute X; references, the Bidit compiler really seems to hate these, I am loath to remove them though, I really like the way `absolute` fixes illegal typecast errors. I'm doing lowlevel bit-twiddling BTW. Obviously there are no errors or warnings in the compilation of code. With DelphiAST so advanced these days I'm half temped to write my own error insight, code completion implementation.

I stumbled upon a new word today: Boolshit

I stumbled upon a new word today: Boolshit It immediately reminded me of code like this: if myBoolVar = True then ... else if myBoolVar = False then ... else //oh shit!

Sorry Embarcadero you are great with WINDOW

Sorry Embarcadero you are great with WINDOW but on Android.. I Started investigation ,for a project, a piece of code for Android just a few lines of code On window it runs great, but On Android waaa.. bad bad. 1. The size 40G i can not run it on S2 (luck of memory) only on S6. 2. Behavior bad. 3. How do you Ebaracdero expect a professional user to work ? 4. Do i research on each pies of code ? wast of time. same exact project with Android Studio 1. The size 780k!! 2. run as expected. I love Delphi and its IDE using it since #1 but it seem i will not use it for Android. I mite be wrong ,i will keep trying. P.S I made all ready a project for Android with Delphi and it works Ok but once started on a new one well... cannot go beyond investigation. To sum it up Delphi is much better , then Android Studio , for designing a project but it lucks the 100% result.

Considering that we now can have constants within records and classes -

Considering that we now can have constants within records and classes - why can't we have resource strings in there? type TMyRec = record const ThisIsOK = 'String'; resourcestring ThisIsNotOK = 'string'; end; [dcc32 Error] : E2029 'END' expected but 'RESOURCESTRING' found

Job losses start to bite as yet again all the 'big' features get shifted forward another year in the updated Delphi roadmap today. Boy am I glad we decided not to use Delphi for mobile dev/mac dev. https://community.embarcadero.com/article/news/16638-rad-studio-august-2018-roadmap?utm_source=article&utm_medium=email&utm_content=Article-180815-RADStudioRoadMap?

Job losses start to bite as yet again all the 'big' features get shifted forward another year in the updated Delphi roadmap today. Boy am I glad we decided not to use Delphi for mobile dev/mac dev. https://community.embarcadero.com/article/news/16638-rad-studio-august-2018-roadmap?utm_source=article&utm_medium=email&utm_content=Article-180815-RADStudioRoadMap ?

Where do you place your unit uses?

Where do you place your unit uses? Over the years, I've come to preferring to place my uses in the Interface section only, even if its types, constants or methods only are used in the implementation section. What is your practice, and why do you prefer one pattern over the others - or why would you recommend against one of these patterns? unit Test; interface uses ThisUnit, ThatUnit; implementation end. vs unit Test; interface uses ThisUnit; implementation uses ThatUnit; end.

I have been working with Delphi since Delphi 5, on and off through the years. I have a few ides for making the code easier to read and I hope to hear some feedback.

I have been working with Delphi since Delphi 5, on and off through the years. I have a few ides for making the code easier to read and I hope to hear some feedback. Delphi classes and records Scope containment Less Typing and, Easier to refactor ,Easier to read Simple = record private fID : Integer; function GetID:Integer; procedure SetID(Vlaue:integer); published property ID : Integer read GetID write SetID; implemented Procedure GetID: Integer; begin result := fID; end; procedure SetID(Value : Integer); begin fID := Value; end; end; Simple = class private fID : Integer; function GetID:Integer; procedure SetID(Vlaue:integer); published property ID : Integer read GetID write SetID; implemented Procedure GetID: Integer; begin result := fID; end; procedure SetID(Value : Integer); begin fID := Value; end; end; I think the value of a for loop should be made available after a loop is completed. I have s...

I wrote a code draft of a cache manager with the purpose of storing entity instances in memory in order to avoid costly and repeated direct fetching of the database.

I wrote a code draft of a cache manager with the purpose of storing entity instances in memory in order to avoid costly and repeated direct fetching of the database. Once cached, the cache manager monitors the database via events, asynchronously updating or removing the cached instances in order to keep the database and cache information synchronized. https://gist.github.com/dipold/9413e70deaca977b5f2528f4f4e23135 I am sharing to get opinions or improvements about it or if you already know any project that does the same (I saw some things integrated into some ORM frameworks only) https://gist.github.com/dipold/9413e70deaca977b5f2528f4f4e23135

An assignment of a record variable on a non-by-reference type should give a warning. Don't you think?

An assignment of a record variable on a non-by-reference type should give a warning. Don't you think? RWithPointers = record Name: string; Plugin: TSomeElaborateClass; class procedure Clean(aInstance: RWithPointers); //class procedure Clean(var aInstance: RWithPointers); static; end; Will not work. But compiles w/o warnings. Need a 'var' parameter: class procedure Clean(var aInstance: RWithPointers); Body: class procedure RWithPointers.Clean(aInstance: RWithPointers); begin // Assigments of members on local variable (going out of scope)... Hey compiler! aInstance.Name := ''; aInstance.Plugin := nil; end; Just asking. Bit me again. Stupid, i know.

What's the piece of Delphi knowledge you find yourself looking up over and over again?

What's the piece of Delphi knowledge you find yourself looking up over and over again? For me format strings is probably the thing that most stubbornly refuses to stay put in my brain. http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.SysUtils.Format

I think I may have mentioned that I hate Variants:

I think I may have mentioned that I hate Variants: What is this code supposed to do, if v1 and v2 are variant arrays with the same content? if v1 = v2 then WriteLn('equal') else WriteLn('not equal'); Of course, it will output ... ? Nothing, it will raise an Invalid Variant Operation error instead because the = operator apparently cannot handle Variant arrays (at least in Delphi 2007). This is a bug that apparently has been in TDbf.Lookup since forever and nobody ever noticed. Or did I do anything wrong here? Did I mention that I hate Variants? https://sourceforge.net/p/tdbf/code/HEAD/tree/trunk/src/dbf.pas#l2141

> The $IF and $ELSEIF directives are terminated with $IFEND, unlike other conditional directives that use the $ENDIF terminator. <

> The $IF and $ELSEIF directives are terminated with $IFEND, unlike other conditional directives that use the $ENDIF terminator. OK System.Classes.pas of Delphi 10.2, Line 1637 (TThread declaration): {$IF Defined(MSWINDOWS)} FHandle: THandle platform; {$ELSEIF Defined(POSIX)} FCreateSuspendedMutex: pthread_mutex_t; FInitialSuspendDone: Boolean; {$ENDIF POSIX} WTF? http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Legacy_IFEND_(Delphi) > At the XE4 release, the Delphi compilers were changed to accept either $IFEND or $ENDIF to close $IF statements. Before XE4, only $IFEND could be used to close $IF statements. The $LEGACYIFEND directive allows you to restore the old behavior, which is useful if your code is emitting E2029 related to nested $IF and $IFDEF statements. WTFF? Why? No wonder that refactoring is unstable. http://docwiki.embarcadero.com/RADStudio/Tokyo/en/IF_directive_(Delphi)

Delphi 10.2.3 Third Party Components

Delphi 10.2.3 Third Party Components In the past it would take a week, two at the most for DevExpress to bring out the latest library for the latest Delphi incarnation. Then Digital Metaphors ( Report Builder ) might be a week or so after that. We pay mega bucks for both of these libraries ! It appears both of them still have no offerings for Delphi 10.2.3. Not only that but no announcements as to when we might expect them. This is what we pay tons of money for eh ! Maybe a post on G+ might shame them ! Has anyone tried the latest versions from DevExpress and Digital Metaphors? Do they work with 10.2.3?

Need Help

Need Help I have write following code to stop duplicate forms to be open but i am getting error as shown below any one can tell me why ? procedure NewForm(InstanceClass:TComponentClass; var Referance); Procedure TMainFrm.NewForm(InstanceClass: TComponentClass; var Referance); var i: Integer; begin for i := 0 to MDIChildCount-1 do if MDIChildren[i] is InstanceClass then begin MDIChildren[i].Show; MDIChildren[i].WindowState := wsMaximized; Exit; end; Application.CreateForm(InstanceClass, Referance); end; Error Message [dcc32 Error] MainFrm_Unit.pas(133): E2014 Statement expected, but expression of type 'TAction' found

I was wondering if someone could write a tutorial on how to create custom ui components such as buttons, tabs etc.

I was wondering if someone could write a tutorial on how to create custom ui components such as buttons, tabs etc. Something I would pay for if it was available.
Stupid RAD Studio. I buy update subscription, you put out out update, I try to update, and my license fails with too many activations. Everytime. You are a database company. I suggest you learn how to use one. The problem? I keep buying update subscriptions to get updates to fix a product with known defects. Solutions include either: if update pushed Inc(allowed update count to allow customer to update if needed), or, quit selling broken update subscriptions you cannot act on. Seriously, I don't have time for this. You put more energy into spamming me than making sure the product works for me. Grr