ข้ามไปยังเนื้อหา

ไฟล์ข้อความ (Text files)

A file keeps data after the program stops

  • The 2026–2028 syllabus (section 8.3) stores data in a text file.
  • You open the file, read or write one item, then close it.
  • This course keeps the file in memory for the one run, so you can see the result.

FOR WRITE เริ่มไฟล์ว่างใหม่และ FOR READ อ่านตั้งแต่บรรทัดแรก; ใช้ OPENFILE, READFILE แล้วตามด้วย CLOSEFILE; READFILE แต่ละครั้งอ่านบรรทัดถัดไปของ Diary.txt

เอกสารประกอบการเรียน

เข้าสู่ระบบหรือสร้างบัญชี

IGCSE, A-Level & AP