// ส่วนที่ 1 : ส่วนกำหนดค่าเริ่มต้นให้กับโปรแกรม setcolor("/w");cls setcolor("/n");@ 1,5 clear to 22,78 setcolor("w/b");@ 2,3 clear to 23,76 startseries:=endseries:=allq:=0 @ 5,5 say "What series number that you want? (start) : " @ 5,60 get startseries @ 7,5 say "What series number that you want? (end) : " @ 7,60 get endseries @ 9,5 say "How many question in each series that you want? : " @ 9,60 get allq setcolor("n/b") @ 3,5 say "This program will create the quiz.(Such as qjava099.htm to qjava140.htm)" @ 11,5 say "Develop by webmaster@thaiall.com" @ 13,5 say "If you have problem on the processing, press CTRL-C." read cls @ 2,1 say "Result of processing" for ss = startseries to endseries if ss < 1000 ; sn = "qjava"+alltrim(str(ss))+".htm" ; end if ss < 100 ; sn = "qjava0"+alltrim(str(ss))+".htm" ; end if ss < 10 ; sn = "qjava00"+alltrim(str(ss))+".htm" ; end set printer to &sn set device to printer do main set device to screen ? ss - startseries + 1, sn , "OK" next procedure main _dbf=[qjava] _title=[เกมตอบคำถาม (ชุดทดสอบตนเอง ก่อนไปออกรายการทีวี)] _by1=[] _by2=[โดย คนไทย เพื่อคนไทย] // ส่วนที่ 2 : ทำหน้าที่สุ่มเลขข้อมา 10 ข้อ ไม่ให้ซ้ำกัน เก็บไว้ใน array 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++ // ส่วนที่ 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[หมายเลขชุด ]+sn+[
];i++ @i,0 say[
];i++ // ส่วนที่ 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++ r++ skip end // ส่วนที่ 6 : ส่วนปิด html @i,0 say[
];i++ @i,0 say[
];i++ @i,0 say[Total score ];i++ @i,0 say[
]+_by1+_by2;i++ @i,0 say[
]+sn;i++ @i,0 say[];i++ return