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

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

Steps Source Editor
1. สร้างโค๊ดในส่วนของ Declaration ให้เสร็จ

(ตัวอย่างนี้ จะเป็นการสร้าง class ขึ้นมา โดยมี Method 2 ตัว คือ Procedure DoSomething กับ Function GetSomething)
PROGRAM Project1;
TYPE
  TMyClass = class(TPersistent)
    FName:string;
    FValue:integer;
    procedure DoSomething;
    function GetSomeThing:integer;
  end;
BEGIN
END. 
2. เลื่อน text curser มาไว้ที่ตำแหน่งไหนก็แต่ขอให้อยู่ภายในบรรทัด ของส่วนประกาศของ TMyClass (แนะนำให้วางแถวสุดท้าย ในบรรทัดที่ 8 หลัง end;)

จากนั้นกดปุ่ม Ctrl+Shift+C พร้อมกัน

โค๊ดในส่วน method implementation ของ 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.1546919225.txt.gz · Last modified: 2019/01/08 10:47 by admin