SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Microsoft® Small Basic Sound, Program, and Text Objects Estimated time to complete this lesson: 1 hour
Sound, Program, and Text Objects In this lesson, you will learn about: Using the Program object to manage execution of Small Basic programs. Using the Text object to work with text-related functions in Small Basic programs. Using the Sound object to enable playback of sounds in Small Basic programs.
Introduction to the Program Object To better understand the Program object, let’s take a look at the example displayed. output In this example, notice the use of Delay and End operations. The Delay operation sets a fixed time delay for the program to execute, and the End operation ends the program execution. When creating programs and working with various objects and operations offered by Small Basic, you might want to control the execution of your program.  You can use the Program object to manipulate how your program executes.
Exploring the Program Object The Program object also allows you to retrieve information about the arguments passed to your program. Let’s take a look at an example to understand how you can use the Program object to determine the count and value of arguments passed to a program during execution.
Introduction to the Sound Object After working with arguments and using the Program object, let’s explore some other interesting aspects of Small Basic. Did you know that you could include sounds in your Small Basic programs? In fact, you can choose from sample sounds provided in the Small Basic library. Look at the example displayed. You can work with sounds in your program by using the Sound object with operations such as Play, Pause, and Stop.  The output of this example plays, pauses, and stops the specified sound file at regular intervals.
Now, let’s take a look at an example to understand how you can play specific sounds, such as a bell ring, chime, or click, in your Small Basic program. Exploring the Sound Object The output will play the sound of a bell ringing, a chime, and a click, at regular intervals. Observe the use of the PlayAndWait operation in the example. The PlayAndWait operation plays an audio file and waits until the audio has finished playing.
Introduction to the Text Object Small Basic also offers useful operations that help you work with text. In Small Basic, when working with text, you can use the Text object and its various functions and methods to perform operations on the text.  For example, to find out the length of a text string, you can use the GetLength operation. Let’s learn some more operations of the Text object with an example...  For example, you may want to convert all names to uppercase. Alternatively, you may want to find out whether a portion of text contains specific information.
More on the Text Object In this example, the user inputs an e-mail address. Using the IsSubText operation of the Text object, you can determine whether the e-mail address is valid or not. Let’s take a look at another example to understand some more operations of the Text object.
Operations of the Text Object Another operation of the Text object is the GetSubText operation. This operation takes three parametersthe text from which you want to derive the subtext, the location from where you want to derive the subtext, and the length up to which you want to derive the subtext. Here are some more uses of the Text object… ,[object Object]
To get the character code for a specific Unicode character, you can use theGetCharacterCodeoperation.
To determine the index position of specific subtext, you can use the GetIndexOf operation.,[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

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
 
5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing codeallenbailey
 
2.6 flickr, image list, and network objects
2.6   flickr, image list, and network objects2.6   flickr, image list, and network objects
2.6 flickr, image list, and network objectsallenbailey
 
Creating a Personalized ipad Wallpaper
Creating a Personalized ipad WallpaperCreating a Personalized ipad Wallpaper
Creating a Personalized ipad Wallpaperszanotti
 
Fd223 cg223 evernote
Fd223 cg223 evernoteFd223 cg223 evernote
Fd223 cg223 evernoteSandra Markus
 
Node mailer example how to send email using nodemailer with gmail & mailtrap
Node mailer example how to send email using nodemailer with gmail & mailtrapNode mailer example how to send email using nodemailer with gmail & mailtrap
Node mailer example how to send email using nodemailer with gmail & mailtrapKaty Slemon
 

Was ist angesagt? (9)

3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aids
 
Moreno Xec
Moreno XecMoreno Xec
Moreno Xec
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
 
5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing code
 
2.6 flickr, image list, and network objects
2.6   flickr, image list, and network objects2.6   flickr, image list, and network objects
2.6 flickr, image list, and network objects
 
Small basic
Small basicSmall basic
Small basic
 
Creating a Personalized ipad Wallpaper
Creating a Personalized ipad WallpaperCreating a Personalized ipad Wallpaper
Creating a Personalized ipad Wallpaper
 
Fd223 cg223 evernote
Fd223 cg223 evernoteFd223 cg223 evernote
Fd223 cg223 evernote
 
Node mailer example how to send email using nodemailer with gmail & mailtrap
Node mailer example how to send email using nodemailer with gmail & mailtrapNode mailer example how to send email using nodemailer with gmail & mailtrap
Node mailer example how to send email using nodemailer with gmail & mailtrap
 

Andere mochten auch

Ch 6 text and sound in alice
Ch 6 text and sound in aliceCh 6 text and sound in alice
Ch 6 text and sound in aliceChaffey College
 
2.3 exploring shapes
2.3   exploring shapes2.3   exploring shapes
2.3 exploring shapesallenbailey
 
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
 
Phonics and Teaching Activities
Phonics and Teaching ActivitiesPhonics and Teaching Activities
Phonics and Teaching ActivitiesCaroline Liu
 
Shareslide presentation
Shareslide presentationShareslide presentation
Shareslide presentationksross
 

Andere mochten auch (17)

Ch 6 text and sound in alice
Ch 6 text and sound in aliceCh 6 text and sound in alice
Ch 6 text and sound in alice
 
2.3 exploring shapes
2.3   exploring shapes2.3   exploring shapes
2.3 exploring shapes
 
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)
 
Phonics and Teaching Activities
Phonics and Teaching ActivitiesPhonics and Teaching Activities
Phonics and Teaching Activities
 
Logo
LogoLogo
Logo
 
Shareslide presentation
Shareslide presentationShareslide presentation
Shareslide presentation
 
Tongue Twisters
Tongue TwistersTongue Twisters
Tongue Twisters
 
Introduction to microsoft word 2007
Introduction to microsoft word 2007Introduction to microsoft word 2007
Introduction to microsoft word 2007
 

Ähnlich wie 2.4 sound, program, and text objects

Using Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) EnvironmentUsing Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) EnvironmentMahmoud Samir Fayed
 
Introducing small basic
Introducing small basicIntroducing small basic
Introducing small basicAn I
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on pythonShubham Yadav
 
JoAnn Rizzo Practicum
JoAnn Rizzo PracticumJoAnn Rizzo Practicum
JoAnn Rizzo Practicumriztwin1
 
Introducing small basic
Introducing small basicIntroducing small basic
Introducing small basicSara Samol
 
Spelling challenge computing
Spelling challenge computingSpelling challenge computing
Spelling challenge computingPaget High School
 
Nltk - Boston Text Analytics
Nltk - Boston Text AnalyticsNltk - Boston Text Analytics
Nltk - Boston Text Analyticsshanbady
 
Solr Cluster installation tool "Anuenue"
Solr Cluster installation tool "Anuenue"Solr Cluster installation tool "Anuenue"
Solr Cluster installation tool "Anuenue"Lucidworks (Archived)
 
Text to speech with Google Cloud
Text to speech with Google CloudText to speech with Google Cloud
Text to speech with Google CloudRajarshi Ghosh
 
Advanced java script essentials v1
Advanced java script essentials v1Advanced java script essentials v1
Advanced java script essentials v1ASHUTOSHPATKAR1
 
The Ring programming language version 1.8 book - Part 93 of 202
The Ring programming language version 1.8 book - Part 93 of 202The Ring programming language version 1.8 book - Part 93 of 202
The Ring programming language version 1.8 book - Part 93 of 202Mahmoud Samir Fayed
 
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...Bill Buchan
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptxHaythamBarakeh1
 

Ähnlich wie 2.4 sound, program, and text objects (20)

django
djangodjango
django
 
Using Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) EnvironmentUsing Python inside Programming Without Coding Technology (PWCT) Environment
Using Python inside Programming Without Coding Technology (PWCT) Environment
 
Introducing small basic
Introducing small basicIntroducing small basic
Introducing small basic
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
 
Go f designpatterns 130116024923-phpapp02
Go f designpatterns 130116024923-phpapp02Go f designpatterns 130116024923-phpapp02
Go f designpatterns 130116024923-phpapp02
 
JoAnn Rizzo Practicum
JoAnn Rizzo PracticumJoAnn Rizzo Practicum
JoAnn Rizzo Practicum
 
Introducing Small Basic.pdf
Introducing Small Basic.pdfIntroducing Small Basic.pdf
Introducing Small Basic.pdf
 
Introducing small basic
Introducing small basicIntroducing small basic
Introducing small basic
 
Spelling challenge computing
Spelling challenge computingSpelling challenge computing
Spelling challenge computing
 
Nltk - Boston Text Analytics
Nltk - Boston Text AnalyticsNltk - Boston Text Analytics
Nltk - Boston Text Analytics
 
PYTHON PPT.pptx
PYTHON PPT.pptxPYTHON PPT.pptx
PYTHON PPT.pptx
 
Python programming
Python programmingPython programming
Python programming
 
Solr Cluster installation tool "Anuenue"
Solr Cluster installation tool "Anuenue"Solr Cluster installation tool "Anuenue"
Solr Cluster installation tool "Anuenue"
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
 
Text to speech with Google Cloud
Text to speech with Google CloudText to speech with Google Cloud
Text to speech with Google Cloud
 
Advanced java script essentials v1
Advanced java script essentials v1Advanced java script essentials v1
Advanced java script essentials v1
 
The Ring programming language version 1.8 book - Part 93 of 202
The Ring programming language version 1.8 book - Part 93 of 202The Ring programming language version 1.8 book - Part 93 of 202
The Ring programming language version 1.8 book - Part 93 of 202
 
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
 
XCode8.0
XCode8.0XCode8.0
XCode8.0
 

Mehr von allenbailey

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.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
 

Mehr von allenbailey (6)

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.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
 

Kürzlich hochgeladen

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
[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
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Kürzlich hochgeladen (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
[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
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

2.4 sound, program, and text objects

  • 1. Microsoft® Small Basic Sound, Program, and Text Objects Estimated time to complete this lesson: 1 hour
  • 2. Sound, Program, and Text Objects In this lesson, you will learn about: Using the Program object to manage execution of Small Basic programs. Using the Text object to work with text-related functions in Small Basic programs. Using the Sound object to enable playback of sounds in Small Basic programs.
  • 3. Introduction to the Program Object To better understand the Program object, let’s take a look at the example displayed. output In this example, notice the use of Delay and End operations. The Delay operation sets a fixed time delay for the program to execute, and the End operation ends the program execution. When creating programs and working with various objects and operations offered by Small Basic, you might want to control the execution of your program. You can use the Program object to manipulate how your program executes.
  • 4. Exploring the Program Object The Program object also allows you to retrieve information about the arguments passed to your program. Let’s take a look at an example to understand how you can use the Program object to determine the count and value of arguments passed to a program during execution.
  • 5. Introduction to the Sound Object After working with arguments and using the Program object, let’s explore some other interesting aspects of Small Basic. Did you know that you could include sounds in your Small Basic programs? In fact, you can choose from sample sounds provided in the Small Basic library. Look at the example displayed. You can work with sounds in your program by using the Sound object with operations such as Play, Pause, and Stop. The output of this example plays, pauses, and stops the specified sound file at regular intervals.
  • 6. Now, let’s take a look at an example to understand how you can play specific sounds, such as a bell ring, chime, or click, in your Small Basic program. Exploring the Sound Object The output will play the sound of a bell ringing, a chime, and a click, at regular intervals. Observe the use of the PlayAndWait operation in the example. The PlayAndWait operation plays an audio file and waits until the audio has finished playing.
  • 7. Introduction to the Text Object Small Basic also offers useful operations that help you work with text. In Small Basic, when working with text, you can use the Text object and its various functions and methods to perform operations on the text. For example, to find out the length of a text string, you can use the GetLength operation. Let’s learn some more operations of the Text object with an example... For example, you may want to convert all names to uppercase. Alternatively, you may want to find out whether a portion of text contains specific information.
  • 8. More on the Text Object In this example, the user inputs an e-mail address. Using the IsSubText operation of the Text object, you can determine whether the e-mail address is valid or not. Let’s take a look at another example to understand some more operations of the Text object.
  • 9.
  • 10. To get the character code for a specific Unicode character, you can use theGetCharacterCodeoperation.
  • 11.
  • 12.
  • 13. If the answer is correct, the program must display a success message along with a chime sound.
  • 14. If the answer is incorrect, the program must display the appropriate message along with the sound of a bell.

Hinweis der Redaktion

  1. You can control the execution of a program by using the Program object in Small Basic. Notice the example on the screen. First, you use the Directory operation to display the current directory of the executing program. To display the path of the directory, you use the TextWindowobject with the WriteLine operation. Next, you want to delay the execution of the program by five seconds, so you use the Delay operation and define the parameter for time in milliseconds.The Program.End() statement forcefully ends the program execution. Check the output of your program by clicking the Run button on the toolbar or pressing F5 on the keyboard. The text window displays the program directory and, after a delay of five seconds, the program ends.
  2. You can also use operations in the program to determine information about the arguments passed to a program. For example, you can use the ArgumentCount operation to find out the number of command-line arguments passed to the program. Similarly, you can use the GetArgument operation that returns the specified argument. You need to provide the index value of the required argument as a parameter to the operation.
  3. To play a sound in your program, you use the Play operation of the Sound object. You specify the path of the local file or the URL of the file on the network as a parameter to the Play operation. Similarly, you use the Pause operation with the path of the file as the parameter. To stop playing the sound, use the Stop operation. In addition, observe the use of the Delay operation of the Program object in the example. The Delay operation helps you delay the execution of commands. You can use various sound-file formats such as .mp3, .wav, or .wma in your Small Basic programs.
  4. Solution:TextWindow.Title = "Let’s take a quiz…" TextWindow.WriteLine("Name the third planet from the Sun: ")answer = TextWindow.Read() If (Text.StartsWith(answer, "Earth") Or Text.StartsWith(answer, "earth")) ThenSound.PlayChime()TextWindow.WriteLine("You are absolutely right!")ElseTextWindow.WriteLine("That is incorrect.")Sound.PlayBellRing()EndIf