Showing posts with label ide. Show all posts
Showing posts with label ide. Show all posts

Thursday, February 15, 2018

Cool features and functions in Delphi

 

List of IDE features that are cool (when they work)

  • Search backwards - Ctrl+F to do a search in your code. F3 to go to the next position Shift+F3 to go to previous position.
  • Move/Relocate/Rename project's files directly from Project Manager
  • Navigate to recently modified code - Ctrl+Shift+F7 and Ctrl+Shift+F8
  • Search for usage - Right click a variable and invoke 'search for usage'. A panel will list all places in current project where that variable is used. In my cases this will make the IDE to freeze. 
  • UML diagrams (Live Diagrams) - simply doesn't work 
  • IDE insight (F6) - It could be useful but seems to list a lot of random items.
  • CodeSite - a logging system - I couldn't really find it useful
  • AQTime - Performance profiler + memory allocation debugger - I couldn't really find it useful


List of functions/units/classes that are cool (when they work)

  • SysUtils.GetHomePath - Returns c:\users\username\appdata\roaming.
  • IOUtils - Lots of new cool functions. Totally broken.
  • SplitString - Example of usage at the end of this document. Unfortunately, the function is VERY slow!
  • FindCmdLineSwitch - Example: System.SysUtils.FindCmdLineSwitch('-f', sFileName)
  • TThread.ProcessorCount;   { Specifies the number of CPU cores in the system }
  • TBinaryReader / TBinaryWriter - Nice but only half ass - Interesting but I recommend this library which is much faster: https://stackoverflow.com/questions/5639531
  • System.Diagnostics.TStopWatch - Can be used to precisely time your code.
  • $WeakLinkRTTI - Put these two directives in your DPR file (at the very top) to reduce exe size with 4%: {$WEAKLINKRTTI ON} {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
  • TStringBuilder - It was supposed to help you build strings. But it is horrible! Simply don't use it. It is painful slow.
  • PtInCircle & PtInRect - Tells you if a point is located in a circle. Could be handy one day.
  • TTimeSpan (System unit) is a data structure used for holding information about a period of time. The smallest unit of time is a tick which is 100 nanoseconds. The largest unit of time is a day.
CONST
  • SLineBreak - global constant that changes its value depending on target platform (Win/Linux/Mac)
  • Win32MajorVersion & Win32MinorVersion - To get current Windows version


List of VCL controls that are cool (when they work)

  • TJumpList - To list a custom file in a JumpList your program must be registered (in Windows registry) to be able to open that type of file. Another problem is that when the user clicks a 'recent file' in the JumpList, the message is not sent to your app directly. You need to intercept that message.









_________________________________

function CountWords(CONST s: string): Integer; { Might be faster than the one above }
VAR
   sArray: TStringDynArray;
begin
  sArray:= System.StrUtils.SplitString(s,  '.,? =<>*!-:;()/\'+cr+lf);
  Result:= Length(sArray);
end;


Monday, October 26, 2015

Delphi XE7 IDE crash due to CnPAck MSDN Help Integrated

After spending 2 full hours I managed to find the culprit for an IDE crash (access violation in VCL210). The cause was ...drum roll please... CnPack!

There was a palette in IDE's main tool bar called MSDN Help. However, when I right click to configure the toolbar, the palette was not listed there to show it/hide it. This probably cause the crash when I tried to remove it by dragging it out of the toolbar.

Friday, February 27, 2015

Delphi bug: Exception EAccessViolation in module rtl210.bpl at 00016A9C [SOLVED]



I keep getting this error at Delphi shut down:

Application Error - Exception EAccessViolation in module rtl210.bpl at 00016A9C.
Access violation at address 50066A9C in module 'rtl210.bpl'. Read of address 06152AF8.

Solution 1:

The problem is fixed by restoring this registry key to its original state: [HKEY_CURRENT_USER\Software\Embarcadero\BDS\15.0\Known IDE Packages]

Here is the pristine value for this key:

[HKEY_CURRENT_USER\Software\Embarcadero\BDS\15.0\Known IDE Packages]
"$(BDS)\\bin\\htmide210.bpl"="(Untitled)"
"$(BDS)\\bin\\comptoolbar210.bpl"="Component Toolbar Package"
"$(BDS)\\bin\\mlcc210.bpl"="(Untitled)"
"$(BDS)\\Bin\\tgide210.bpl"="(Untitled)"
"$(BDS)\\Bin\\delphiosx32210.bpl"="Delphi OSX32 Platform"
"$(BDS)\\Bin\\macosxdebugide210.bpl"="MacOS"
"$(BDS)\\Bin\\delphiwin64210.bpl"="Delphi Win64 Platform"
"$(BDS)\\Bin\\win64debugide210.bpl"="(Untitled)"
"$(BDS)\\Bin\\GuidedTour210.bpl"="Embarcadero Guided Tour Package"
"$(BDS)\\Bin\\ModernTheme210.bpl"="(Untitled)"
"$(BDS)\\Bin\\asmview210.bpl"="Assembly Browser Package"
"$(BDS)\\Bin\\dbkdebugide210.bpl"="(Untitled)"
"$(BDS)\\Bin\\delphiwin32210.bpl"="Delphi Win32 Platform"
"$(BDS)\\Bin\\dotnetcoreide210.bpl"=".NET Core IDE Package"
"$(BDS)\\bin\\exceptiondiag210.bpl"="(Untitled)"
"$(BDS)\\bin\\fileexplorer210.bpl"="(Untitled)"
"$(BDS)\\bin\\historyide210.bpl"="(Untitled)"
"$(BDS)\\Bin\\htmlhelp2210.bpl"="HtmlHelp Viewer"
"$(BDS)\\bin\\idefilefilters210.bpl"="IDE File filters"
"$(BDS)\\bin\\plugview210.bpl"="Pluggable Tree View Package"
"$(BDS)\\Bin\\projpageide210.bpl"="Value Data: Project and template library package"
"$(BDS)\\Bin\\startpageide210.bpl"="Start Page IDE Package"
"$(BDS)\\Bin\\tlbview210.bpl"="TypeLibrary Browser Package"
"$(BDS)\\Bin\\codetemplates210.bpl"="(Untitled)"
"$(BDS)\\bin\\coreproide210.bpl"="Core IDE Pro Package"
"$(BDS)\\bin\\dbkdebugproide210.bpl"="(Untitled)"
"$(BDS)\\Bin\\profiledeployide210.bpl"="(Untitled)"
"$(BDS)\\Bin\\profilemgride210.bpl"="(Untitled)"
"$(BDS)\\Bin\\sdkmgride210.bpl"="Embarcadero SDK Manager"
"$(BDS)\\bin\\refactoride210.bpl"="Core Refactoring Package"
"$(BDS)\\bin\\todoide210.bpl"="ToDo"
"$(BDS)\\Bin\\comcore210.bpl"="HtmlHelp Viewer"
"$(BDS)\\Bin\\projecttargets210.bpl"="(Untitled)"
"$(BDS)\\Bin\\vclmenudesigner210.bpl"=".NET Core IDE Package"
"$(BDS)\\Bin\\DataExplorerIDE210.bpl"="(Untitled)"
"$(BDS)\\Bin\\unittestide210.bpl"="(Untitled)"
"$(BDS)\\Bin\\iteidew32210.bpl"="(Untitled)"
"$(BDS)\\Bin\\VisualizationServiceIDE210.bpl"="Visualization IDE Service Package"
"C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\15.0\\Experts\\IDEFixPackStartup.bpl"="IDE Fix Pack Startup"


[UPDATE]
SOLUTION 2 (and cause):

After some work I discovered what caused this: The 'FMX controls' package was disabled (probably I disabled it since FMX is still infantile and I don't intend to use it right now). Re-enabling this package solved the problem.

Also removing "$(BDS)\\Bin\\delphiwin32210.bpl"="Delphi Win32 Platform" helped.

Delphi: Access violation in module 'bindcomp210.bpl'


I keep getting an "Access violation at address 1204F872 in module 'bindcomp210.bpl'. Read of address 1423C764" message during Delphi startup.

After poking around I have found the solution: delete the
"Project" and/or "SaveFileDirectory" keys in [HKEY_CURRENT_USER\Software\Embarcadero\BDS\15.0\Session]


Wednesday, February 25, 2015

Delphi developers are now charged for bug fixes [via Update Subscription]

Starting this year Embarcadero has a new plan to milk money from its customers. With the new 'Update Subscription' plan, Embarcadero wants to charge 30% from original purchase price, each year, each customer that wants access to product bug fixes (that were not supposed to be there anyway).
Eve more, there is no warranty that the customer will actually get the bug fixes. Embarcadero clearly states that: "All fixes, updates and hotfixes are purely at Embarcadero's discretion."
Actually it states that twice. So, don't miss to read it :)

Ongoing Maintenance and Hot-Fixes for Previous Versions*

In the middle of a development cycle on an older IDE version? The RAD Studio team will now continue to release critical updates and hotfixes for up to two (2) years and three (3) major versions, improving your investment and enabling you to upgrade to the latest version on your schedule. All maintenance updates and hotfixes will only be available to users on an active Subscription and cannot be downloaded or purchased separately. Versions currently under Ongoing maintenance include XE7, XE6, and XE5 versions. Active subscribers will also have immediate access to beta hotfixes, providing the most timely access to critical fixes. All fixes, updates and hotfixes are purely at Embarcadero's discretion.
Link


Some stores are already selling upgrade subscriptions for 2000 pounds + VAT.



There is another way to get updates?
No. The FAQ clearly states it:

Can I obtain updates and hotfixes without a subscription?
An active update subscription is the only way to obtain updates and hotfixes for current and prior (up to 2 years) releases.


















I see a big incoming wave of programming towards Lazarus.



Sunday, January 16, 2011

Those sundried-brain old school PHP programmers

Those sundried-brain old school PHP programmers

It is a shame that in these modern days some people are still coding in Notepad. Many of them as still far away from advanced concepts such as IDE. RAD? Well, they never heard of it. Framework? What’s that? (or, as one of them said “why use a framework…  I can do all that code by had”).

Some days ago I had to share a PHP project with some other coders. It looks like some of them have problems to understand what RadPhp is and keep telling me that the package of source code files I send to them is incomplete - and of course then they were asking for the "missing" files. RadPhp is a RAD, a IDE and a framework. The files that they THINK I forgot to distribute were part of this framework. There are 6285 of PHP/JS (and other) files in this framework. I believe at that moment that it was pointless to email them all those files since they already have them on their hard drive. But it looks like that even if I told them that the project was made in RadPhp AND it requires RadPhp, they decided to do the development in their old Notepad (nothing like a good old plain text editor, right boys? He-he). No matter as magnificent Notepad is, it cannot replace those 6285 files framework. So obviously my script was kept crying for the “missing” files. I hope I can convice those guys that the script will not work until they install the framework. What? “Framework”? I used that nasty word again? Sorry. I promise I will not do it again.

---------------

For all other PHP people that already know what a framework is, I deeply really apologize for this lemon-acid rant. For rest of them: Guys take a fucking dictionary and look for IDE,RAD and framework, or just download the damn thing and you will understand!

Tuesday, June 1, 2010

Delphi 2007 - (bad) Review

Delphi 2007 - Same old stuff under a new hat?


We all love Delphi. It is smart, easy to understand, really fast and user friendly.
But is the IDE the one that makes is so nice or the language?
Every time Borland released a new version forced as to go through a painful learning and re-adaptation process. But not because of the language but because of the buggy IDE.
You can't argue with me: there are HUGE lists of unresolved bugs for every possible version released.
It is the same for Delphi 2007? Let’s find out. I just installed Delphi 2007 on my computer. First time I was really glad to have it because people ware speaking nice about this new version.
After the first attempt to install it failed, I tried again and I somehow succeed.

Until now I can report more bad stuff that good ones. Anyway I am still happy that I can report also good stuff.
Compared with Delphi 2005, Delphi 2007 is a charm. Compared with Delphi 2006 it is a little bit better. Compared with Delphi 7 it is worst.

* I thought that Delphi 2007 is free of .Net. Well that was a lie. Delphi 2007 refuses to install without .Net 2.0 (and other craps like this).

* The first bug I saw few minutes after I open the IDE for the first time was the fast blinking icons in the tool bar. I had the same problem with Delphi 2005 and 2006.

* The next bug, this time a really big one was the help system which in 30% is working. Imagine yourself what is with the rest of 70%.
The help system is a disaster. It takes much more time to load than Delphi itself. If you ask help for an instruction/window on IDE it always answers: 'Error. No help found for 2029. OK | Details'.
When it does not display that stupid answer then it returns allot of garbage from MS .Net and MS API help. In most cases the right answer is not there.
For example after pressing F1 for while the cursor was on the reserved word 'Function', the help system returned (after 37 seconds!).




Conclusions?

* Sometimes the cursor has the same color as the IDE background. You can have big fun trying to figure out where is your cursor on the screen. The solution is to restart the IDE and pray to work. If not, restart again (and pray harder).

* Delphi 2007 takes a lot of time to load to memory (my system is AMD 64 x2 4.6GHz and 1GB DDR2 at 800MHz). The average amount of memory for small projects is 50-120MB. But sometimes if goes to 600-1000MB.


So you need at least 2GB or RAM to work with this version of Delphi.

* Other small problems can be observed in IDE. Many windows behave strange or you have no buttons to configure them. For example if you have error when you compile a program, the 'Messages' will pop-up at the bottom of the IDE. This is ok. Right? But after you fix the problem the window does not close itself as in Delphi 7. So every time you compile a program you need to go and manually close that window.

* The undo system is also a disaster. Sometimes is working, sometimes (most of the cases) is not. So if you made a mistake you can't undo it so you need to rewrite all that code.

I don't think that Delphi 2007 is better than Delphi 7. Actually it is a disaster. Not as big as Delphi 2005 but still a disaster. I hope that Borland (hic, CodeGear) will release a patch (or more) really soon, but until then Delphi 2007 can't be used.
I didn't post here every small bug I have found, but only the big ones. I will update this entry as I will find out more.

Now I am supposed to speak also about the good parts of Delphi 2007. Well until I will have the patch to be able to run Delphi 2007 form more than 1 hour, I will post also the nice parts of Delphi 2007, until then I will stick with Delphi 7 and with its already known bugs (and work around).

Please drop me a line if you know how to make the help system to work and how to remove the useless (MS API) results from a search.