Delphi Programming Tutorial – Unit 8.5 – Code Shortcuts and Assistance In Delphi

Delphi Tutorial – Unit 8.5 – Code Shortcuts and Assistance In Delphi:

In the previous few tutorials, we learned how to write code for the events of a Delphi object. In this tutorial, we learn how to use some of Delphi’s design time features to help us while writing code in the Code Editor.

You will see how Delphi helps you to remember the names of your objects and how all the properties and methods belonging to those objects are presented to you while typing your code.

We also learn how use short-cuts and keyboard keys to auto complete the code for us.

This will help us to type much faster and it also makes our code less error prone and free from spelling mistakes. This is made possible by forcing us to only use strictly defined names.

We replace the current statement in the Display button’s event handler with three new statements to learn and practise the lessons in this tutorial.

While typing this code the video is paused to explain the different features available for auto-completion. You learn that programmers may sometimes work on other parts of a project for long periods of time, and when it is time to write code for some objects, they tend to forget the names assigned to those objects.

To overcome this problem, you are shown how to use keyboard keys (Control + Space) in conjunction with your naming convention (prefixes) to obtain a list of objects starting with the prefix you typed. The information provided by these lists provide programmers with a vast amount of information, such as names, data types, required parameters, etc.

After programming the new statements in our event handler for the click event of the Display button must be as follows:

procedure TfrmContact.btnDisplayClick(Sender: TObject);
begin
redOutput.Color := clYellow;
frmContact.Caption := ‘Displaying Contact Information’;
redOutput.Lines.Add(‘Displaying Contact Information’);
end;

This code changes the colour of our TRichEdit (named redOutput) to yellow, sets the Caption of our Form (named frmContact) to the phrase “Displaying Contact Information”, and adds a new line to the TRichEdit’s (named redOutput) Lines collection.

PS. Please, help us to keep these Delphi tutorials FREE. Keep our sponsors happy and click the LIKE button. Also SHARE these Delphi tutorials with your friends and encourage them to also SUBSCRIBE. Participate in discussions, ask questions and tell us about your experience in the COMMENTS section of a Delphi tutorial.

This tutorial (Delphi Programming Tutorial – Unit 8.5 – Code Shortcuts and Assistance In Delphi) is best viewed in HD. To change your settings to HD:

1. Click on the gear-icon (Settings) at the bottom of the YouTube Video Player.

2. Select “720p HD” and wait a few moments for the setting to take effect.

Enjoy!

For more Delphi video tutorials also join us at https://www.learndelphi.net.

You may also want to visit the following resources for more information:

https://cc.embarcadero.com
https://www.lazarus-ide.org
https://www.planet-source-code.com
https://www.delphi.about.com
https://www.embarcadero.com
https://www.edn.embarcadero.com
http://techteachers.co.za
http://www.studyopportunities.co.za
https://www.facebook.com/DelphiSchools
http://www.lazarus-ide.org/
http://www.delphibasics.co.uk http://stackoverflow.com/

Comments

Nikola Milosevic says:

I agree with others, you explain so well! Great job!

Keenan Pillay says:

Thanks so much for the tutorials. I’m learning so much from you :)

James Lucas Gilbert says:

great tutorials! thank you

Write a comment

*

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles▷ Show Cars▷ Motorbikes▷ Scooters▷ Bicycles▷ Rims & Tires▷ Luxury BoatsFashion▷ Sunglasses▷ Luxury Watches▷ Luxury Purses▷ Jeans Wear▷ High Heels▷ Kinis Swimwear▷ Perfumes▷ Jewellery▷ Cosmetics▷ Shaving Helpers▷ Fashion HatsFooding▷ Chef Club▷ Fooding Helpers▷ Coktails & LiquorsSports▷ Sport Shoes▷ Fitness & Detox▷ Golf Gear▷ Racquets▷ Hiking & Trek Gear▷ Diving Equipment▷ Ski Gear▷ Snowboards▷ Surf Boards▷ Rollers & SkatesEntertainment▷ DIY Guides▷ Zik Instruments▷ Published Books▷ Music Albums▷ Cine Movies▷ Trading Helpers▷ Make Money▷ Fishing Equipment▷ Paintball Supplies▷ Trading Card Games▷ Telescopes▷ Knives▷ VapesHigh Tech▷ Flat Screens▷ Tech Devices▷ Camera Lenses▷ Audio HiFi▷ Printers▷ USB Devices▷ PC Hardware▷ Network Gear▷ Cloud Servers▷ Software Helpers▷ Programmer Helpers▷ Mobile Apps▷ Hearing AidsHome▷ Home Furniture▷ Home Appliances▷ Tools Workshop▷ Beddings▷ Floor Layings▷ Barbecues▷ Aquarium Gear▷ Safe Boxes▷ Office Supplies▷ Security Locks▷ Cleaning ProductsKids▷ Baby Strollers▷ Child Car Seats▷ Remote ControlledTravel▷ Luggages & Bags▷ Airlines Seats▷ Hotel Rooms▷ Fun Trips▷ Cruise Ships▷ Mexico Tours