SlideShare una empresa de Scribd logo
1 de 13
Microsoft® Small Basic Clock, Desktop, and Dictionary Objects Estimated time to complete this lesson: 1 hour
Clock, Desktop, and Dictionary Objects In this lesson, you will learn about: Using different properties of the Clock object. Using different operations of the Dictionary object. Using different properties and operations of the Desktop object.
The Clock Object Let’s explore some properties of the Clock object… Small Basic provides you with a Clock object to include this logic in your programs. You can use the Clock object to write programs that use the system clock. The Clock object has different properties, such as Date, Hour, Time, and Year. While programming, you may encounter situations where you need to calculate time or perform certain actions based on the date and time.
Date, Weekday, and Time You can use the Date property, the WeekDay property, and the Time property of the Clock object to get the current system date, day, and time respectively. output Let’s look at an example that displays the current system date, day of the week, and time on the graphics window…
The Year Property You can use the Year property of the Clock object to get the current system year. Let’s take an example that uses the Year property of the Clock object to calculate age… Click the               button on the toolbar.
 You can use the Month and the Day property of the Clock object to get the current month and current day, respectively. Month and Day In this example, the output window displays birthday wishes only if the month and the day entered by the user matches with the current system month and day. output How about writing a program that greets you on your birthday?
Hour, Minute, and Second   You can get the current hour, minute, and second of the day with the help of the Hour, Minute, and Second properties of the Clock object. Let’s combine the Hour, the Minute, and the Second properties of the Clock object to display a digital clock on the graphics window… output
The Desktop Object In addition, you can also retrieve the size of your current desktop and use the information to specify the location of objects on the screen. Small Basic provides another object called Desktop. You can use this object to set a desktop wallpaper of your choice. Let’s explore the SetWallPaper operation of the Desktop object. You can choose your wallpaper from any local file or network file, or from an Internet URL.
The Desktop Object You can use the Height and Width properties of the Desktop object to get the screen height and width, respectively, of the primary desktop. Let’s apply these properties on the graphics window. output
The Dictionary Object Dictionary is a useful resource that you can include as part of your Small Basic program. The Dictionary object has two operations—GetDefinitionand GetDefinitionInFrench Small Basic provides a Dictionary object that you can use to retrieve the meaning of a specified word from the online Dictionary service.
The Dictionary Object You can use the GetDefinitionoperation to obtain the meaning of a word, in English. For the definition in French, use the GetDefinitionInFrenchoperation. For example, let’s use the GetDefinitionoperation to find out the meaning of the word, “Magnanimous.”
Let’s Summarize… Congratulations! Now you know how to: Use different properties of the Clock object. Use different properties and operations of the Desktop object. Use different operations of the Dictionary object.
It’s Time to Apply Your Learning… Create a program to set an alarm that plays a bell ring sound and changes the wallpaper of your desktop.

Más contenido relacionado

Destacado

1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basicallenbailey
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loopsallenbailey
 
2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics windowallenbailey
 
Basic logo-command
Basic logo-commandBasic logo-command
Basic logo-commanddat298
 
2.2 turtle graphics
2.2   turtle graphics2.2   turtle graphics
2.2 turtle graphicsallenbailey
 
In-bai tap logo_01 (hsinh)
  In-bai tap logo_01 (hsinh)  In-bai tap logo_01 (hsinh)
In-bai tap logo_01 (hsinh)saobiennt
 
Msw logo application user manual for teacher
Msw logo application user manual for teacherMsw logo application user manual for teacher
Msw logo application user manual for teacherfarah510
 
In-bai tap logo_02 -thu tuc (hs)
  In-bai tap logo_02 -thu tuc (hs)  In-bai tap logo_02 -thu tuc (hs)
In-bai tap logo_02 -thu tuc (hs)saobiennt
 
Logo primitives
Logo primitivesLogo primitives
Logo primitivessshaner88
 
In-bai tap logo_02 -thu tuc (gv)
  In-bai tap logo_02 -thu tuc (gv)  In-bai tap logo_02 -thu tuc (gv)
In-bai tap logo_02 -thu tuc (gv)saobiennt
 

Destacado (13)

1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basic
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loops
 
2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics window
 
Basic logo-command
Basic logo-commandBasic logo-command
Basic logo-command
 
2.2 turtle graphics
2.2   turtle graphics2.2   turtle graphics
2.2 turtle graphics
 
In-bai tap logo_01 (hsinh)
  In-bai tap logo_01 (hsinh)  In-bai tap logo_01 (hsinh)
In-bai tap logo_01 (hsinh)
 
Msw logo
Msw logoMsw logo
Msw logo
 
Msw logo application user manual for teacher
Msw logo application user manual for teacherMsw logo application user manual for teacher
Msw logo application user manual for teacher
 
In-bai tap logo_02 -thu tuc (hs)
  In-bai tap logo_02 -thu tuc (hs)  In-bai tap logo_02 -thu tuc (hs)
In-bai tap logo_02 -thu tuc (hs)
 
Logo primitives
Logo primitivesLogo primitives
Logo primitives
 
Geometria de las Tortugas
Geometria de las  TortugasGeometria de las  Tortugas
Geometria de las Tortugas
 
In-bai tap logo_02 -thu tuc (gv)
  In-bai tap logo_02 -thu tuc (gv)  In-bai tap logo_02 -thu tuc (gv)
In-bai tap logo_02 -thu tuc (gv)
 
Logo
LogoLogo
Logo
 

Similar a Microsoft® Small Basic Clock, Desktop, and Dictionary Objects

Weka tutorial
Weka tutorialWeka tutorial
Weka tutorialGRajendra
 
Intro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & ClassesIntro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & ClassesBlue Elephant Consulting
 
Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++Blue Elephant Consulting
 
Laboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart DevicesLaboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart DevicesGeneXus
 
Xerte gettingstarted
Xerte gettingstartedXerte gettingstarted
Xerte gettingstartedWosho
 
WP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightWP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightMICTT Palma
 
(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1Aaron Angeles
 
Ms project 2000 tutorial
Ms project 2000 tutorialMs project 2000 tutorial
Ms project 2000 tutorialpaolocollector
 
Data Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing TransformationsData Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing TransformationsSafe Software
 
Captivate 9 Features
Captivate 9 FeaturesCaptivate 9 Features
Captivate 9 FeaturesAman Vohra
 
How To Create Calendar View In Odoo 16
How To Create Calendar View In Odoo 16How To Create Calendar View In Odoo 16
How To Create Calendar View In Odoo 16Celine George
 
Windows 10 update 1809 cfcs oct14 2018
Windows 10 update 1809  cfcs oct14 2018Windows 10 update 1809  cfcs oct14 2018
Windows 10 update 1809 cfcs oct14 2018hewie
 
Oracle User Productiviy Kit
Oracle User Productiviy KitOracle User Productiviy Kit
Oracle User Productiviy KitLarry Sherrod
 
Java script browser objects 1
Java script browser objects 1Java script browser objects 1
Java script browser objects 1H K
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360RapidValue
 
Courselab Quick start guide
Courselab Quick start guideCourselab Quick start guide
Courselab Quick start guideBob Price
 
Laboratorio: Desarrollo para Smart Devices (continuación)
Laboratorio: Desarrollo para Smart Devices (continuación)Laboratorio: Desarrollo para Smart Devices (continuación)
Laboratorio: Desarrollo para Smart Devices (continuación)GeneXus
 

Similar a Microsoft® Small Basic Clock, Desktop, and Dictionary Objects (20)

XCode8.0
XCode8.0XCode8.0
XCode8.0
 
Weka tutorial
Weka tutorialWeka tutorial
Weka tutorial
 
Intro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & ClassesIntro to C++ - Class 2 - Objects & Classes
Intro to C++ - Class 2 - Objects & Classes
 
Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++Intro To C++ - Class 2 - An Introduction To C++
Intro To C++ - Class 2 - An Introduction To C++
 
Laboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart DevicesLaboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart Devices
 
Xerte gettingstarted
Xerte gettingstartedXerte gettingstarted
Xerte gettingstarted
 
Seminar report
Seminar reportSeminar report
Seminar report
 
WP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightWP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a Silverlight
 
(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1
 
Ms project 2000 tutorial
Ms project 2000 tutorialMs project 2000 tutorial
Ms project 2000 tutorial
 
Data Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing TransformationsData Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing Transformations
 
Captivate 9 Features
Captivate 9 FeaturesCaptivate 9 Features
Captivate 9 Features
 
How To Create Calendar View In Odoo 16
How To Create Calendar View In Odoo 16How To Create Calendar View In Odoo 16
How To Create Calendar View In Odoo 16
 
Windows 10 update 1809 cfcs oct14 2018
Windows 10 update 1809  cfcs oct14 2018Windows 10 update 1809  cfcs oct14 2018
Windows 10 update 1809 cfcs oct14 2018
 
Oracle User Productiviy Kit
Oracle User Productiviy KitOracle User Productiviy Kit
Oracle User Productiviy Kit
 
Part1
Part1Part1
Part1
 
Java script browser objects 1
Java script browser objects 1Java script browser objects 1
Java script browser objects 1
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360
 
Courselab Quick start guide
Courselab Quick start guideCourselab Quick start guide
Courselab Quick start guide
 
Laboratorio: Desarrollo para Smart Devices (continuación)
Laboratorio: Desarrollo para Smart Devices (continuación)Laboratorio: Desarrollo para Smart Devices (continuación)
Laboratorio: Desarrollo para Smart Devices (continuación)
 

Más de allenbailey

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing codeallenbailey
 
4.4 advanced games
4.4   advanced games4.4   advanced games
4.4 advanced gamesallenbailey
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detectionallenbailey
 
4.2 responding to events
4.2   responding to events4.2   responding to events
4.2 responding to eventsallenbailey
 
4.1 playing with shapes
4.1   playing with shapes4.1   playing with shapes
4.1 playing with shapesallenbailey
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aidsallenbailey
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivityallenbailey
 
3.3 the math object
3.3   the math object3.3   the math object
3.3 the math objectallenbailey
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arraysallenbailey
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and outputallenbailey
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operationsallenbailey
 

Más de allenbailey (11)

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing code
 
4.4 advanced games
4.4   advanced games4.4   advanced games
4.4 advanced games
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detection
 
4.2 responding to events
4.2   responding to events4.2   responding to events
4.2 responding to events
 
4.1 playing with shapes
4.1   playing with shapes4.1   playing with shapes
4.1 playing with shapes
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aids
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
 
3.3 the math object
3.3   the math object3.3   the math object
3.3 the math object
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arrays
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and output
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operations
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Microsoft® Small Basic Clock, Desktop, and Dictionary Objects

  • 1. Microsoft® Small Basic Clock, Desktop, and Dictionary Objects Estimated time to complete this lesson: 1 hour
  • 2. Clock, Desktop, and Dictionary Objects In this lesson, you will learn about: Using different properties of the Clock object. Using different operations of the Dictionary object. Using different properties and operations of the Desktop object.
  • 3. The Clock Object Let’s explore some properties of the Clock object… Small Basic provides you with a Clock object to include this logic in your programs. You can use the Clock object to write programs that use the system clock. The Clock object has different properties, such as Date, Hour, Time, and Year. While programming, you may encounter situations where you need to calculate time or perform certain actions based on the date and time.
  • 4. Date, Weekday, and Time You can use the Date property, the WeekDay property, and the Time property of the Clock object to get the current system date, day, and time respectively. output Let’s look at an example that displays the current system date, day of the week, and time on the graphics window…
  • 5. The Year Property You can use the Year property of the Clock object to get the current system year. Let’s take an example that uses the Year property of the Clock object to calculate age… Click the button on the toolbar.
  • 6.  You can use the Month and the Day property of the Clock object to get the current month and current day, respectively. Month and Day In this example, the output window displays birthday wishes only if the month and the day entered by the user matches with the current system month and day. output How about writing a program that greets you on your birthday?
  • 7. Hour, Minute, and Second   You can get the current hour, minute, and second of the day with the help of the Hour, Minute, and Second properties of the Clock object. Let’s combine the Hour, the Minute, and the Second properties of the Clock object to display a digital clock on the graphics window… output
  • 8. The Desktop Object In addition, you can also retrieve the size of your current desktop and use the information to specify the location of objects on the screen. Small Basic provides another object called Desktop. You can use this object to set a desktop wallpaper of your choice. Let’s explore the SetWallPaper operation of the Desktop object. You can choose your wallpaper from any local file or network file, or from an Internet URL.
  • 9. The Desktop Object You can use the Height and Width properties of the Desktop object to get the screen height and width, respectively, of the primary desktop. Let’s apply these properties on the graphics window. output
  • 10. The Dictionary Object Dictionary is a useful resource that you can include as part of your Small Basic program. The Dictionary object has two operations—GetDefinitionand GetDefinitionInFrench Small Basic provides a Dictionary object that you can use to retrieve the meaning of a specified word from the online Dictionary service.
  • 11. The Dictionary Object You can use the GetDefinitionoperation to obtain the meaning of a word, in English. For the definition in French, use the GetDefinitionInFrenchoperation. For example, let’s use the GetDefinitionoperation to find out the meaning of the word, “Magnanimous.”
  • 12. Let’s Summarize… Congratulations! Now you know how to: Use different properties of the Clock object. Use different properties and operations of the Desktop object. Use different operations of the Dictionary object.
  • 13. It’s Time to Apply Your Learning… Create a program to set an alarm that plays a bell ring sound and changes the wallpaper of your desktop.

Notas del editor

  1. We have used the DrawBoundText operation of the GraphicsWindow object. This operation will draw a line of text at the specified location. We have specified the x- and y-coordinates of the text starting point as 40 and 40. Code:date = Clock.Dateweekday = Clock.WeekDaytime = Clock.Timedisplay = ("Current Date: " + date + "," + "Current Weekday: " + weekday + "," + " Current Time: " + time)GraphicsWindow.DrawBoundText(40, 40, GraphicsWindow.Width, display)
  2. Code:TextWindow.WriteLine("Enter the year of your birth:")birthyear = TextWindow.Read()age = Clock.Year - birthyearTextWindow.WriteLine("Your age is " + age + ".")
  3. You must be connected to the Internet to use the Dictionary object in Small Basic.
  4. Code:txt = "Magnanimous"GraphicsWindow.FontName = "verdana"GraphicsWindow.FontSize = 24GraphicsWindow.BrushColor = "Black"GraphicsWindow.DrawText(10, 10, txt)defn = Dictionary.GetDefinition(txt)GraphicsWindow.FontSize = 12GraphicsWindow.BrushColor = "Black"GraphicsWindow.DrawText(10, 60, defn)
  5. Solution:subSetAlarm()imagePath = program.Directory + "desk.jpg" up:IfClock.Time = alarm ThenDesktop.SetWallPaper(imagePath) Sound.PlayBellRing() EndIfProgram.Delay(1000)Goto up SubsubSetAlarmTextWindow.WriteLine("Set Alarm")TextWindow.Write("Enter Hour: ") hour = TextWindow.Read()TextWindow.Write("Enter Minute: ") minute = TextWindow.Read()TextWindow.Write("AM/PM?: ")AmPmStatus = TextWindow.Read() alarm = hour + ":" + minute + ":00 " + AmPmStatusTextWindow.WriteLine("Alarm Time: " + alarm)EndSub