User Tools

Site Tools


Sidebar


Introduction


Basic Tutorials


Advance Tutorials


Useful Techniques


Examples

  • Simple Pipe Weight Calculator
  • Unit Convertor

Sidebar

tutorial:hotkey

This is an old revision of the document!


Useful Hot-Keys

Hot-keys ที่สำคัญที่ผมจะแนะนำมีดังนี้ครับ

Ctrl + Shift + C

ใช้สำหรับการเขียนโค๊ดใน Source Editor โดยเมื่อกดสามปุ่มดังนี้แล้ว จะเป็นการสร้าง implementation ของ Procedure/Function อย่างรวดเร็ว ไม่ต้องเสียเวลามาพิมพ์โค๊ดในส่วนนี้เอง วิธีใช้ ต้อง

Steps Source Editor
1. สร้างโค๊ดในส่วนของ Declaration ให้เสร็จ
program Project1;
type
  TMyClass = class(TPersistent)
    FName:string;
    FValue:integer;
    procedure DoSomething;
    function GetSomeThing:integer;
  end;
begin
end. 
2. เลื่อน text curser มาไว้ที่ตำแหน่งไหนก็แต่ขอให้อยู่ภายในบรรทัด ของส่วนประกาศของ TMyClass (แนะนำให้วางแถวสุดท้าย ในบรรทัดที่ 8 หลัง end;) โค๊ดในส่วน implementation ของ method ของ TMyclass จะถูกสร้างขึ้นมาทันที
program Project1;

type

  { TMyClass }

  TMyClass = class(TPersistent)
    FName:string;
    FValue:integer;
    procedure DoSomething;
    function GetSomeThing:integer;
  end;

{ TMyClass }

procedure TMyClass.DoSomething;
begin

end;

function TMyClass.GetSomeThing: integer;
begin

end;

begin
end. 
tutorial/hotkey.1546916602.txt.gz · Last modified: 2019/01/08 10:03 by admin