// ส่วนที่ 1 : ส่วนกำหนดค่าเริ่มต้นให้กับโปรแกรม set printer to "qjaval.htm" set device to printer _dbf=[qjava] _title=[เกมตอบคำถาม (ชุดทดสอบตนเอง ก่อนไปออกรายการทีวี)] _by1=[] _by2=[โดย คนไทย เพื่อคนไทย] // ส่วนที่ 2 : ทำหน้าที่สุ่มเลขข้อมา 10 ข้อ ไม่ให้ซ้ำกัน เก็บไว้ใน array allq=10 use &_dbf allquest=reccount() arn=array(allq) i=0;j=0 while i]+_title+[];i++ @i,0 say [];i++ @i,0 say[];i++ @i,0 say[];i++ @i,0 say[];i++ // ส่วนที่ 4 : ส่วน html เริ่มต้น @i,0 say[];i++ @i,0 say[];i++ @i,0 say[
]+_title;i++ @i,0 say[
];i++ @i,0 say[ให้ใช้ Mouse เลือกคำตอบ จากนั้นจะแจ้งผลถูกผิดทันที
];i++ @i,0 say[รุ่น 3.2001 (เขียนให้ท่าน copy โปรแกรม และข้อมูลไปใช้ และแก้ไขได้ทุกกรณี)
];i++ @i,0 say[
];i++ @i,0 say[
];i++ do listquiznumber // ส่วนที่ 5 : ส่วนสร้างข้อสอบ ในรูป form เลือกข้อสอบจากค่าที่ได้จากการสุ่ม use &_dbf r=1 while r<=allq go arn[r] _no=alltrim(no); _ques=alltrim(ques) _c1=alltrim(c1); _c2=alltrim(c2) _c3=alltrim(c3); _c4=alltrim(c4) fr=alltrim(str(r)) @i,0 say [

โชคดีจงเป็นของท่าน
];i++ @i,0 say[
];i++ @i,0 say[];i++ @i,0 say[

    ];i++ @i,0 say [
    ];i++ @i,0 say fr+[. ]+_ques+[ --- (]+_no+[)];i++ for f=1 to 4 ft=alltrim(str(f)) fr=alltrim(str(r)) txt=[
    ] @i,0 say txt+&("_c"+ft);i++ next @i,0 say[
];i++ @i,0 say[
];i++ @i,0 say[Score for this question
];i++ @i,0 say[- ดูคะแนนรวม - กลับไปข้อแรกสุด ];i++ @i,0 say[- ไปข้อสอบข้อต่อไป -
];i++ do listquiznumber @i,0 say[
];i++ r++ skip end // ส่วนที่ 6 : ส่วนปิด html @i,0 say[
];i++ @i,0 say[
];i++ @i,0 say[Total score ];i++ do listquiznumber @i,0 say[
]+_by1+_by2;i++ @i,0 say[];i++ procedure listquiznumber @i,0 say[ไปยังข้อสอบข้อที่ ];i++ n=1 while n<=allq fr=alltrim(str(n)) @i,0 say [- ]+fr+[];i++ n++ end @i,0 say [ -];i++ return