บทที่ 5 คำสั่ง Clrscr;
คำสั่ง clrscr; = คำสั่ง ล้างหน้าจอครับผม เรามาดูตัวอย่าง ง่ายๆกันดีกว่า
หมายเหตุ คำสั่งนี้ต้องใช้ควบคู่กับ Uses crt; นะครับ
ลองพิมตามเลยนะครับ
program it4x;
uses crt;
begin
clrscr;
writeln('it4x it4x it4x');
readln;
end.
เวลา Run (ctrl+F9) ก็จะได้ผลลัพธ์ดังนี้

แต่ถ้าเราไม่ใส่ clrscr; ผลรันของเราก็จะ ไม่มีการล้างหน้าจอเดิม ทำให้ดูไม่สวยงาม
program it4x;
uses crt;
begin
writeln('it4x it4x it4x');
readln;
end.

หวังว่าคงเข้าใจคำสั่ง clrscr; กันมากขึ้นนะครับ เราสามารถนำไปดัดแปลงได้หลายอย่างเลยทีเดียว ^^
เอาไปลงต่อที่ไหนกรูณาให้ Credit ที่เว็ปนี้ด้วยนะครับ
Credit : www.it4x.com
คำสั่ง clrscr; = คำสั่ง ล้างหน้าจอครับผม เรามาดูตัวอย่าง ง่ายๆกันดีกว่า
หมายเหตุ คำสั่งนี้ต้องใช้ควบคู่กับ Uses crt; นะครับ
ลองพิมตามเลยนะครับ
program it4x;
uses crt;
begin
clrscr;
writeln('it4x it4x it4x');
readln;
end.
เวลา Run (ctrl+F9) ก็จะได้ผลลัพธ์ดังนี้

แต่ถ้าเราไม่ใส่ clrscr; ผลรันของเราก็จะ ไม่มีการล้างหน้าจอเดิม ทำให้ดูไม่สวยงาม
program it4x;
uses crt;
begin
writeln('it4x it4x it4x');
readln;
end.

หวังว่าคงเข้าใจคำสั่ง clrscr; กันมากขึ้นนะครับ เราสามารถนำไปดัดแปลงได้หลายอย่างเลยทีเดียว ^^
เอาไปลงต่อที่ไหนกรูณาให้ Credit ที่เว็ปนี้ด้วยนะครับ
Credit : www.it4x.com