thaiall logomy background
coding : intro. randomarray.asp.
my town
Source : Perl | PHP | ASP | JSP | HTML | HTML5 | JavaScript | Java | COBOL | C++ | MS Access | VBNet | VB | Python | โค้ดดี
File : randomarray.asp. ID : 2108
Skin : Default | Sons-of-obsidian | Sunburst | Highlighter | Full
<body>
<form action=randomarray.asp method=post>
Max : <input type=text name=nummax size=5 value=999> <br>
Min : <input type=text name=nummin size=5 value=1> <br>
Amt : <input type=text name=numamt size=5 value=15> <br>
<input type=submit value=Random><input type=reset value=Reset>
</form>
<%
numamt = int(request.form("numamt"))
nummax = int(request.form("nummax"))
nummin = int(request.form("nummin"))
' แก้ไขบรรทัดข้างล่างนี้ โดยเติม +1 เข้าไป เพราะจะผิดคุณสมบัติของ max,min
if numamt > (nummax - nummin + 1) or numamt = 0 or numamt > 999 then 
  response.write( "Invalid command")
else
  randomize   
  dim arr(999)
  i = 1
  do while i <= numamt
    x = int(nummin  + (rnd * ( nummax - nummin + 1)))
    found = 0
    for j = 1 to i - 1
      if arr(j) = x then found = 1
    next
    if found = 0 then
      arr(i) = x
      i = i + 1
    end if
  loop
  for k = 1 to numamt
    response.write( arr(k) & "<br>")      
  next
  erase arr
end if
%>
</body>
จำนวน : 36 บรรทัด
าษาเฮชทีเอ็มแอล (HTML = HyperText Markup Language) คือ ภาษาคอมพิวเตอร์ที่ออกแบบมาเพื่อใช้ในการสร้างเว็บเพจที่เรียกดูผ่านทางเว็บเบราว์เซอร์ (Web Browser) เริ่มพัฒนาโดย ทิม เบอร์เนอรส์ ลี (Tim Berners Lee) ในปัจจุบัน HTML ล่าสุดคือ รุ่น 5 เป็นมาตรฐานหนึ่งของ ISO ซึ่งจัดการโดย World Wide Web Consortium (W3C) ในปัจจุบัน ทาง W3C ผลักดัน รูปแบบของ HTML แบบใหม่ ที่เรียกว่า XHTML รุ่นแรกคือ 1.0 (ม.ค.2543) ซึ่งมีโครงสร้างเป็นแบบ XML (eXtensible Markup Language)
ตัวอย่าง Hello World
ปรับปรุงโปรแกรม source.pl : 2565-07-24
rspsocial
Thaiall.com