วันอาทิตย์ที่ 28 กรกฎาคม พ.ศ. 2556

Google X


G
oogle X
สุดยอดโครงการในอนาคตของกูเกิล

source :          http://occupatech.blogspot.com


As you know, Google - is not only a search engine: The company is a world leader in the creation of gadgets, internet services, and more. The most curious development team is engaged in a secret Google X, and among their projects -  here are 10 ideas that the Internet giant seeks to bring to life.
ก็อย่างที่เราทราบกันดีว่า Google ไม่ใช่เพียงแค่ Search Engine (เว็บไซต์ให้บริการสืบค้นข้อมูล)  แต่เป็นบริษัทยักษ์ใหญ่ที่สร้างสรรค์ Gadgets (อุปกรณ์อิเล็กทรอนิกส์ขนาดเล็ก)  การให้บริการต่างๆ ผ่านเครือข่ายอินเทอร์เน็ต ฯลฯ   แต่ตอนนี้ทีมงานพัฒนาสุดเทพ (the most curious development team) ของพวกเขา  กำลังซุ่มทำโครงการลับ Google X (x คือ 10 ตามเลขโรมันนั่นแหละ)


googlefuture01 10 проектов будущего от Google
1. Car without a driver will make road traffic safer
Experts of Google X for several years working on the project Driverless Car Program.
Negotiations are underway with the authorities for permission to test the self-governing vehicles on public roads - as long as this agreement only states of California and Nevada.
A fleet of ten vehicles with test systems allow run over more than 480 thousand km (as of August of 2012), and of course, tests are continuing. However, it is unclear when such a system will be commercially available.

โครงการขั้นเทพแรกสุดของเจ้าพ่ออินเทอร์เน็ตรายนี้ก็คือ รถยนต์ไร้คนขับ   กูเกิลต้องไปเจรจาขออนุญาตจากทางการ
(negotiations are underway with the authorities for permission) ที่จะทดสอบรถยนต์ที่มันควบคุมตัวมันเองได้  (to test the self-governing vehicles)  บนถนนหลวง (on public roads)  ของสองมลรัฐเท่านั้น คือ มลรัฐแคลิฟอร์เนีย (แค่รัฐนี้ก็มีพื้นที่ใหญ่กว่าประเทศไทยแล้ว)  กับมลรัฐเนวาดา  (ก็อย่างว่าแหละ ถนนในสองมลรัฐนี้มันวิ่งผ่านทะเลทรายซะเป็นส่วนใหญ่ การจราจรบนถนนมันจึงเบาบาง จึงเหมาะกับการทดสอบรถยนต์อัจฉริยะของกูเกิลเขาล่ะนะ)   ตอนนี้พวกหมู่เขาชาวกูเกิลก็เลือกเอารถยนต์รักษ์โลก Toyota Prius สุดยอดรถยนต์ลูกผสม (Hybrid) อันโด่งดังของค่ายรถยนต์ยักษ์ใหญ่ของโลก (ขณะนี้ Toyota เป็นกลุ่มยานยนต์ที่มียอดการขายรวมสูงสุดเป็นอันดับ 1 ของโลกไปแล้ว  จากรถยนต์ในกลุ่มหลายแบรนด์ คือ Toyota, Hino, Dihatsu, Lexus)  มาทำการทดสอบระบบนี้อยู่  มีรถยนต์ที่ทดสอบระบบนี้นับสิบคัน  ต้องวิ่งยาวๆ เกือบ 5 แสนกิโลเมตร  เลยทีเดียว



googlefuture02 10 проектов будущего от Google
2. Google Glass will change the way you think about gadgets
Having put on those glasses, you can forget about the screens of smartphones and computers - the right information will always be available in only one eye movements.
One way to look up - and before you calendar, email, social networks, weather, in general, everything that you want.
Google Glass makes a revolutionary technology available to a wide range of people so far only a few lucky people, mostly developers and journalists were able to get a working prototype of points, but the consumers opportunity arises next year.

แว่นตาวิเศษของกูเกิล
 คือถ้าลองได้สวมแว่นตาสุดเทพนี้ละก็  เห็นท่าว่าเราคงจะลืมหน้าจอของสมาร์ตโฟน (ที่เราว่าเจ๋งแล้วนา) และหน้าจอคอมพิวเตอร์สุดโปรดของเราไปเลย  คือ ข้อมูลข่าวสารทั้งหลายที่เราอยากจะรู้  อาทิ วันเวลา  อีเมล์  สภาพอากาศ  แม้แต่สื่อสังคอมออนไลน์ (อาทิ facebook)  มันจะเผยโฉมให้เราเห็นได้ เพียงแค่เรากระดิกพลิกตาเราเท่านั้นแหละ (หวังว่ากูเกิ้ลคงไม่ได้โม้นะ) 



googlefuture03 10 проектов будущего от Google
3. "Smart House" according to Google
The technology, called Android @ Home, will fully automate all of the life support system by connecting to the Internet, for example, while you are not home, a refrigerator will be able to order the necessary products itself, and coffee maker to make coffee exactly to your arrival.
Android @ Home will connect all electrical appliances.

บ้านอัจฉริยะ
 
ในแนวคิดของกูเกิ้ล  เทคโนโลยีนี้เรียกว่า 
Android @ Home  ซึ่งจะเนรมิตให้บ้านกลายเป็นบ้านอัตโนมัติ ด้วยการเชื่อมต่อกับอินเทอร์เน็ต  ยกตัวอย่าง  ขณะที่เราไม่อยู่บ้าน ตู้เย็นในบ้านเรามันสามารถจะสั่งของกินเอาไว้ให้เราได้เอง  และเครื่องชงกาแฟมันก็ชงกาแฟไว้คอยท่าเราตอนกลับบ้าน   ระบบแอนดรอยด์@โฮมที่ว่า มันจะเชื่อมต่อกับเครื่องใช้ไฟฟ้าทั้งหลายแหล่ในบ้าน


googlefuture04 10 проектов будущего от Google
4. Space elevator
According to published in the journal «Time» information Google X team in 2011, the year included the idea of ​​a "space elevator" in the so-called list of "What if ...". I must say, the very concept of this method of delivery to the orbit of people and goods put forward by K. Tsiolkovsky in 1895, the year.
Do not wait for Google's early implementation of this idea - the development of "lift into orbit," presents many technical challenges, and all the more likely to say that to implement this idea in life is impossible. However, it's probably Google thus "cover their tracks" to save the process of developing a secret.

ลิฟต์อวกาศ
 
เป็นแนวคิดที่จะส่งอะไรต่อมิอะไรไปไว้ในอวกาศ (the very concept of this method of delivery to the orbit of people and goods) ซึ่งถ้าจะว่าไป ก็คงเป็นข้อมูลข่าวสารนั่นแหละ เพราะเมื่อมันอยู่ในอวกาศได้ โอกาสที่มนุษย์ธรรมดาจะไปล้วง ไปเจาะ ไปแฮ็กข้อมูล มันก็คงจะยากขึ้นอ่ะนะ

 
googlefuture05 10 проектов будущего от Google
5. Watch a smartphone based on Android
Recently, it was reported that Google is preparing a direct competitor iWatch from Apple - a watch, combined with the smartphone: of course, watches SmartWatch smartphone from Google will use the operating system Android.
This latest «must have»-new to the gadget lovers will be available early next year.

นาฬิกาอัจฉริยะ
 
SmartWatch  ที่รวมเอา smartphone กับนาฬิกา มาไว้ด้วยกัน  แล้วใช้ระบบปฏิบัติการ Android  ก็คือคู่แข่งของ iWatch จากค่าย Apple นั่นแหละ 

 
googlefuture06 10 проектов будущего от Google
6. Google will take care of your health
The Internet giant has a stake in the company Adimab, engaged in the development of diagnostics and treatment of various diseases, which would bring a variety of technologies and methods to combat diseases. The revolutionary idea is the invention of miniature sensors involved in the search and optimization of antibodies produced by the body - to start treatment only need to swallow such a sensor.
Another development in the field of Google Health is a subsidiary of iPierian, creating the technology of "cellular reprogramming» (cellular reprogramming), which will fight the disease by modifying cells.
 Google เพื่อสุขภาพ   กูเกิลเข้าไปถือหุ้นในบริษัท Adimab  ที่ทำธุรกิจเกี่ยวกับการพัฒนาและวิจัยเกี่ยวกับการตรวจและรักษาโรคต่างๆ  แนวคิดก็คือ การประดิษฐ์ miniature sensors (ตัวตรวจจับขนาดจิ๋ว) ที่จะตรวจหาและปรับสารแอนติบอดีในร่างกายคน  เพื่อเริ่มการรักษา เพียงแค่กลืนตัวเซนเซอร์ที่ว่านี้เข้าไปแค่นั้น (to start treatment only need to swallow such a sensor)  นอกจากนี้กูเกิลยังจะพัฒนา Cellular reprogramming  (การโปรแกรมใหม่ให้เซล)  ซึ่งจะช่วยต่อต้านโรคร้ายได้ ด้วยการปรับแต่งเซลใหม่

  
googlefuture07 10 проектов будущего от Google
7. Internet airships cover the entire planet wireless
Google's ambitions as a provider of Internet reached all-time highs - the company is developing airships that will provide wireless connectivity the entire planet, including remote regions in Africa and other parts of the Earth.
If the project is realized, the "world wide web" will get about another 1 billion people - mostly residents of the "third world."
 
ยานอินเทอร์เน็ต
   เพื่อจะทำการส่งสัญญาณอินเทอร์เน็ตแบบไร้สายไปให้โลกทั้งใบ  ไม่ว่าจะอยู่ส่วนไหนในโลก  อาทิ ดินแดนที่ห่างไกลในทวีปแอฟริกา  ก็สามารถเข้าถึงอินเทอร์เน็ตได้


googlefuture08 10 проектов будущего от Google
8. Game console based on Android
The popularity of the Android platform is growing all over the world, and Google is seeking to use its potential to the maximum.
«Wall Street Journal» spoke about the development of the gaming console from Google, which is designed to be a "killer" similar technology "Yabloko» - Apple TV: game console from Google allows you to run any Android-games directly on your home television.

เกมคอนโซลในระบบแอนดรอยด์   
แพล็ตฟอร์มแอนดรอยด์มาแรงแซงเวอร์ไปทั่วโลกแล้ว  ยักษ์กูเกิลก็จะยิ่งดันให้มันแรงสุดๆ ไปเลย ด้วยการสร้างเกมคอนโซลที่สามารถรันได้จากสมาร์ตทีวี (ตอนนี้ประเทศไทยยังไม่มีอ่ะนะ ทีวีอัจฉริยะแบบที่ว่า)

 
googlefuture09 10 проектов будущего от Google
9. The way Google determines the development of smart phones Motorola
Buy Google of Motorola Mobility (transaction was $ 12.5 billion) to become the owner of the first allowed 24.5 thousand patents and designs.
Under the wing of the Internet giant will release a smartphone Motorola Moto X based on Android, which has all the modern features and characteristics, as well as, of course, a number of trendy "chips", which has no rivals - release date already quite close.
 Moto X สมาร์ตโฟน   กูเกิลไปจับมือกับค่าย Motorola สร้างสมาร์ตโฟน Moto X ที่รันบนระบบแอนดรอยด์  โดยกะว่า จะมีศักยภาพไร้เทียมทานกว่าใครใคร
 
googlefuture10 10 проектов будущего от Google
10. Eco-friendly sources of energy
The company Makani Power - developer of advanced technologies in the use of wind and solar energy: Google previously invested in the company a lot of money, and recently acquired in its entirety and included in the project, which deals with Google X.
The best-known development Makani Power - wind turbines, hovering at an altitude of almost 300 m to 650 m-minute and allow to generate electricity out of thin air.

 
แหล่งกำเนิดพลังงานที่เป็นมิตรกับสิ่งแวดล้อม   ใช้เทคโนโลยีก้าวหน้าจากพลังงานลม และพลังงานแสงอาทิตย์  กูเกิลกับพันธมิตรลงทุนไปหลายตังค์ในการพัฒนา 

 

วันอังคารที่ 23 กรกฎาคม พ.ศ. 2556

The Atmosphere of World Class Programming Competition





  The Atmosphere of World Class Programming Competition

 

source :          http://occupatech.blogspot.com

Here is the atmosphere of the World class Programming Competition that be held in St.Petersberg, European Russia.
บรรยากาศการแข่งขันการแข่งขันเขียนโปรแกรมระดับโลก ที่จัดขึ้นที่นครเซนต์ปีเตอร์สเบิร์กส์  ประเทศรัสเซียส่วนที่อยู่ในทวีปยุโรป

brains00 800x532 Brains


brains01 Brains
1. Sports arena. One hundred and twenty teams.Two cameras online broadcast.  .. absolute silence all five hours.
สถานที่แข่งขันการโปรแกรมระดับโลกนี้ต้องใช้สถานที่ขนาดยักษ์ล่ะนะ นั่นคือ สปอร์ตอารีน่า  มีทีมเข้าร่วมการแข่งขัน 120 ทีม  แข่งกันภายใต้บรรยากาศเงียบวังเวงอยู่ 5 ชั่วโมง
brains02 Brains
2. No action, just incredible mental work.  
ทำอะไรไม่ได้  อาศัยนั่งคิดอยู่ในใจ
brains03 Brains
3. 
brains04 Brains
4. This is the final of an international team championship on programming ACM ICPC. For the first time in history, it took place in Russia.
แข่งขันกันที่ประเทศรัสเซีย  เป็นการแข่งขันรอบสุดท้าย 
brains05 Brains
5. This is the steepest in the world team competition programmers.
นี่เป็นการแข่งขันเขียนโปรแกรมระดับโลก ที่จัดได้ว่าหินที่สุดแล้ว
brains06 Brains
6. 35,000 participants from 91 countries in 2322 universities have struggled to get into this room, and solve 11 challenging algorithmic problems 
มีผู้เข้าร่วมงานนี้ รวมกันก็กว่า 3 หมื่นคน  จาก 90 ประเทศ  สถาบันการศึกษา 2 พันกว่าแห่ง 

brains07 Brains
7. This is the best young brains in the world.
นี่แหละสุดยอดเยาวชนสมองเพชรของโลก

brains08 Brains
8. Despite the fact that they are still studying in universities, those who reached the final are already employed
แม้ว่าพวกเขาจะกำลังศึกษาอยู่ก็จริง  แต่ถ้าใครเข้ามาถึงรอบสุดท้ายได้ ก็มีงานรออยู่แล้ว

brains09 Brains


brains10 Brains
10. They are already guaranteed salary of 120,000 dollars per year and the proportion of shares in companies
มันสมองเหล่านี้ จะมีเงินเดือนปีละกว่า 120,000 เหรียญสหรัฐ (ตีเป็นเงินไทย ก็ประมาณ 3 ล้านกว่าบาท)


brains11 Brains

brains12 Brains


brains13 Brains


brains14 Brains


brains15 Brains
15. They are waiting for the company that you use every day - it's Google, Facebook, Yandex ... And of course a complex and interesting startups. Work in banks they consider "the floor."
เด็กพวกนี้อยากทำงานกับ Google, Facebook, Yandex  เป็นงานท้าทาย น่าสนใจ  ส่วนการทำงานแบ็งค์ ถือว่าเป็นงานบ้านๆ ธรรมดาๆ

brains16 Brains


brains17 Brains


brains18 Brains
18.
brains19 Brains
19.
brains20 Brains
20.
brains21 Brains
21.

brains22 Brains
22. Balls are awarded for completed tasks as well as for other services such as "The first team to perform a task F"
brains23 Brains
23. After 5 hours, these guys in black T-shirts will be victorious. Before that, in different combinations, pererburgskaya team at the National Research University of Information Technologies, Mechanics and Optics (ITMO) became world champions four times.
ทีมชนะเลิศคือ ทีมของสาขาเครื่องกลและแสง มหาวิทยาลัยวิจัยเทคโนโลยีสารสนเทศแห่งชาติ(รัสเซีย)

brains24 Brains
24. Second place went to the team of Shanghai University of Technology, the third - the University of Tokyo
อันดับสองคือ ทีมหาวิทยาลัยเทคโนโลยีเซี่ยงไฮ้ (ประเทศจีน)  อันดับสามคือ ทีมมหาวิทยาลัยโตเกียว ๖ประเทศญี่ปุ่น)
brains25 Brains



brains26 Brains
26. For those who know the basics of probability theory and is able to program the task may seem simple, but it is not - at the approach of the parameters of the assumed boundaries have serious problems ...

brains27 Brains


brains28 Brains
28.
brains29 Brains
29.
brains30 Brains
30.
brains31 Brains
31.
brains32 Brains
32.
brains33 Brains
33.

brains34 Brains
34.

brains35 Brains
35.

brains36 Brains
36.

brains37 Brains

Visual Basic 6.0 : Exercise 2 " Pizza Order"


Visual Basic 6.0 : Exercise 2 " Pizza Order"




source :          http://occupatech.blogspot.com

Exercise 2

Pizza Order Application

 We had just learned about programming with Microsoft Visual Basic 6.0 and tried to create two Windows applications (using Visual Basic 6.0), the first one was "Stop Watch" and the second was "Calendar/Time".  Some people have told me, the teacher, that it is interesting and challenging, while some other people have never said any word but have just thought that it is boring. Yes, the teacher realizes that programming is so valuable because it can develop anyone both systematic thinking and solving. Well, the teacher knows  that anybody can never hand on it if he is not interested in programming. But, now the teaching is not over, the show must go on! 

วกเราได้เรียนรู้เกี่ยวกับการโปรแกรมด้วยภาษาวิชวลเบสิก 6.0  และได้ลองพัฒนาแอ็ปปลิเคชันที่ทำงานในระบบวินโดวส์ 2 แอ็ป ด้วยกัน  โดยแอ็ปแรกเป็นนาฬิกาจับเวลา แอ็ปที่สองเป็นแอ็ปบอกวันเวลา  นักเรียนหลายคนก็บอกกับครูว่า "น่าสนใจและท้าทายมาก"  ขณะที่นักเรียนอีกหลายคนไม่พูดอะไรสักแอ่ะ...คิดอยู่อย่างเดียวว่า "มันน่าเบื่อ"   ใช่เลย..ครูตระหนักดีอยู่เสมอว่า ความจริงแล้วนะ.. การเรียนรู้เรื่องการโปรแกรมมันมีคุณค่าในตัวของมันเองอยู่แล้ว  เพราะมันเป็นการพัฒนาผู้เรียนให้รู้จักการคิด/การแก้ปัญหาอย่างเป็นระบบ  ครู..ทราบดีว่า.. นักเรียนคนไหนก็ตามที่รู้สึกว่าตนเองไม่สนใจในเรื่องของการโปรแกรมแล้วละก็ คงยากนะที่จะเอาดีในเรื่องนี้ได้ ... แต่ช้าก่อน... การเรียนการสอนก็คงหยุดไม่ได้ ... ก็ต้องว่ากันต่อไป..



  "Pizza Order" Application
แอ็ปปลิเคชัน "สั่งพิซซ่า"

     SOURCE  :   www.kidwares.com

1. Start a new project.  We'll build a form where a pizza order can be entered by simply clicking on check boxes and option buttons.
ให้นักเรียนเข้าไปที่หน้าจอหลักของ Microsoft Visual Basic 6.0 เหมือนที่เราเคยทำ ด้วยการเลือก Standard EXE เพื่อสร้าง New project .... อย่าลืม Save นะ  ซึ่งการ Save ครั้งแรก จะเป็น Save As โดยนักเรียนต้อง Save ฟอร์มก่อน แล้วจึง save โปรเจ็กต์ ... เลือก Folder ให้เรียบร้อย  (เรื่องนี้ นักเรียนถูกย้ำมาจนเป็นทักษะดีอยู่แล้วจากครูผู้สอน)  ตอนนี้เรากำลังจะสร้างแอ็ปสั่งพิซซ่า  โดยผู้ใช้ก็แค่ทำการคลิกเลือกตัวเลือก และติ๊กรายการต่างๆ แล้วสั่งการผ่านปุ่มคำสั่ง..

2. Draw three frames.  In the first, draw three option buttons, in the second, draw two option buttons, and in the third, draw six check boxes.  Draw two option buttons on the form.  Add two command buttons.  Make things look something like this.
ให้นักเรียนวาดเฟรม (frame) 3 เฟรม  แล้ววาดปุ่มอ็อปชัน (option button) ใส่ไว้ในเฟรมแรก 3 ปุ่ม  ส่วนเฟรมที่สองวาดปุ่มอ็อปชันใส่ไว้ 2 ปุ่ม  ส่วนเฟรมที่สามวาด check box ใส่ไว้ 6 ช่อง ด้วยกัน  แล้ววาดปุ่มอ็อปชันอีกสองปุ่มใส่ไว้ในฟอร์ม (ดูโซน 4 ประกอบ)  และวาด command button (ปุ่มคำสั่ง) สองปุ่ม (ไว้ในโซน 5)

Fig.1  The Form which is being designed by us.
นี่เป็นฟอร์มที่กำลังได้รับการออกแบบจากนักเรียน



3. Set the properties of the form and each control.
หลังจากออกแบบเสร็จแล้ว ต่อไปนักเรียนต้อง set the properties (ตั้งค่าคุณสมบัติ) ของฟอร์ม และคอนโทรล (control )แต่ละตัว  ดังนี้

 



  • Form1:
    BorderStyle    1-Fixed Single
    Caption          Pizza Order
    Name            frmPizza
  • Frame1:
    Caption    Size

  • Frame2:
    Caption    Crust Type

  • Frame3
    Caption    Toppings


  • Option1:
    Caption    Small
    Name      optSize
    Value      True

  • Option2:
    Caption    Medium
    Name      optSize (yes, create a control array)

  • Option3:
    Caption    Large
    Name      optSize

  • Option4:
    Caption    Thin Crust
    Name       optCrust
    Value       True

  • Option5:
    Caption    Thick Crust
    Name       optCrust (yes, create a control array)

  • Option6:
    Caption    Eat In
    Name    optWhere
    Value    True

  • Option7:
    Caption    Take Out
    Name       optWhere (yes, create a control array)

  • Check1:
    Caption    Extra Cheese
    Name      chkTop

  • Check2:
    Caption    Mushrooms
    Name       chkTop (yes, create a control array)

  • Check3:
    Caption    Black Olives
    Name       chkTop


  • Check4:
    Caption    Onions
    Name      chkTop

  • Check5:
    Caption    Green Peppers
    Name      chkTop

  • Check6:
    Caption    Tomatoes
    Name      chkTop

  • Command1:
    Caption    &Build Pizza
    Name      cmdBuild

  • Command2:
    Caption    E&xit
    Name      cmdExit





4. Declare the following variables in the general declarations area:
ให้นักเรียนเลือก View/Code   แล้วพิมพ์ Source codes ในส่วนของ  general declarations (ส่วนประกาศทั่วไป)     เพื่อประกาศตัวแปร (to declare the variables) 3 ตัว เป็นตัวแปรชนิด String (เก็บข้อมูลที่เป็นข้อความ)  ได้แก่  PizzaSize (เก็บข้อมูลขนาดของพิซซ่าที่ลูกค้าสั่ง),  PizzaCrust (เก็บข้อมูลว่า ลูกค้าสั่งพิซซ่าที่มีขอบบางหรือหนา),   PizzaWhere (เก็บข้อมูลว่า พิซซ่าที่ลูกค้าสั่งนั้น จะกินที่ร้าน หรือแพ็กห่อ)

    Option Explicit
      Dim PizzaSize As String
      Dim PizzaCrust As String
      Dim PizzaWhere As String




5. Attach this code to the Form_Load procedure.  This initializes the pizza size, crust, and eating location.
ให้นักเรียนผูกโค้ด (attach code) เข้ากับฟอร์ม  (โดยการทำดับเบิลคลิกที่ฟอร์ม  ก็จะเข้าสู่โมดูล หรือโพรซิเยอร์ (procedure) ที่ชื่อ Form_Load แล้วนักเรียนก็ใส่โค้ดเข้าไป  บรรดาโค้ดตรงนี้ จะเป็นการกำหนดค่าเริ่มต้น (initialization) ให้กับตัวแปรทั้งสามตัว ที่เราประกาศไว้ คือ PizzaSize, PizzaCrust และ PizzaWhere

Private Sub Form_Load()
  PizzaSize = "Small"
  PizzaCrust = "Thin Crust"
  PizzaWhere = "Eat In"
End Sub




6.  Attach this code to the three option button array Click events.  Note the use of the Index variable:
ให้นักเรียน attach code เข้ากับปุ่มอ็อปชันในแต่ละเฟรม (โดยดับเบิลคลิกที่ปุ่มอ็อปชันใดๆ ในเฟรมนั้น แล้วใส่โค้ด)


Private Sub optSize_Click(Index As Integer)
[ดับเบิลคลิกที่ปุ่ม optSize (ใดก็ได้ในสามปุ่ม ของโซน 1) แล้วใส่โค้ดข้างล่างนี้เข้าไป ]
  PizzaSize = optSize(Index).Caption
  (โค้ดนี้ จะให้อ่านค่า จำนวนเต็ม 0, 1 หรือ 2 ซึ่งแทนขนาดเล็ก กลาง ใหญ่  ของขนาดถาดพิซซ่า เอาค่าไปเก็บไว้ในตัวแปร PizzaSize)
End Sub

Private Sub optCrust_Click(Index As Integer)
[ดับเบิลคลิกที่ปุ่ม optCrust (ใดก็ได้ในสองปุ่ม ของโซน 2) แล้วใส่โค้ดข้างล่างนี้เข้าไป ] 
  PizzaCrust = optCrust(Index).Caption
  (โค้ดนี้ จะให้อ่านค่า จำนวนเต็ม 0 หรือ 1 ซึ่งแทนขอบพิซซ่า อย่างบาง หรืออย่างหนา  เอาค่าไปเก็บไว้ในตัวแปร PizzaCrust)
End Sub

Private Sub optWhere_Click(Index As Integer)
[ดับเบิลคลิกที่ปุ่ม optWhere (ใดก็ได้ในสองปุ่ม ของโซน 4) แล้วใส่โค้ดข้างล่างนี้เข้าไป ] 
   PizzaWhere = optWhere(Index).Caption
    (โค้ดนี้ จะให้อ่านค่า จำนวนเต็ม 0 หรือ 1 ซึ่งแทนว่าจะกินพิซซ่าที่ไหน กินที่ร้าน หรือนำกลับบ้าน  เอาค่าไปเก็บไว้ในตัวแปร PizzaWhere)
End Sub



7. Attach this code to the cmdBuild_Click event.
ให้นักเรียน attach code ต่อไปนี้  เข้าไปที่ปุ่มคำสั่ง cmdBuild

Private Sub cmdBuild_Click()
  Dim Message As String
  Dim I As Integer
  Message = PizzaWhere + vbCr
  Message = Message + PizzaSize + " Pizza" + vbCr
  Message = Message + PizzaCrust + vbCr
        For I = 0 To 5
  If chkTop(I).Value = vbChecked Then Message = Message + chkTop(I).Caption + vbCr
      Next I
      MsgBox Message, vbOKOnly, "Your Pizza"
End Sub


This code forms the first part of a message for a message box by integrating the pizza size, crust type, and eating location (vbCr is a symbolic constant representing a ‘carriage return’ that puts each piece of ordering information on a separate line).  Next, the code cycles through the six topping check boxes and adds any checked information to the message.  The code then displays the pizza order in a message box.
โค้ดในส่วนนี้ จะทำการสร้าง message ในลักษณะของ message box  ที่จะบูรณาการเอา ขนาดของพิซซ่า  ขอบหนาหรือบาง และจะกินที่ร้านหรือแพ็กกล่อง (vbCr คือ symbolic constant หรือค่าคงที่ ในภาษาวิชวลเบสิกที่หมายถึงการสั่งให้ขึ้นบรรทัดใหม่ หรือ carriage return ก็คือ "การปัดแคร่" ซึ่งขอยืมศัพท์ของพิมพ์ดีดมาอีกทีนั่นเอง)



8.  Attach this code to the cmdExit_Click event.
ผูกคำสั่ง End เข้ากับปุ่มคำสั่ง cmdExit
Private Sub cmdExit_Click()
  End
End Sub




9.  Run the application, the message box will be appeared.
เมื่อรันโปรแกรม ก็จะได้ application ที่มี user interface แบบนี้


The Application User Interface
นี่คือหน้าตาของแอ็ปปลิเคชันของเรา



Message Box
เม็ซเสซบ็อกซ์ที่ได้