Microsoft Small Basic
Program Listing:
Embed this in your website
<object id='sbapp' data='data:application/x-silverlight-2,' type='application/x-silverlight-2' width='640' height='480'> <param name='source' value='http://smallbasic.com/program/ClientBin/SBWeb.xap'/> <param name='onError' value='onSilverlightError' /> <param name='background' value='white' /> <param name='minRuntimeVersion' value='3.0.40624.0' /> <param name='autoUpgrade' value='true' /> <param name='initParams' value='programId=NXK897' /> </object>
'Published as
'Ask the user to enter an adverb, save it as currentAdverb -- # 2.0
currentAdverb
=
MessageBox
.
AskForInput
(
"Enter an adverb"
)
'Ask the user to enter a verb ending in '-ed', save it as currentEdVerb -- # 3.0
currentEdVerb
=
MessageBox
.
AskForInput
(
"Enter a verb ending in -ed"
)
'Ask the user to enter an body part, save it as currentBodyPart -- # 4.0
currentBodyPart
=
MessageBox
.
AskForInput
(
"Enter a body part"
)
'Set the value of the currentStory to the word "Today "-- # 1.0
currentStory
=
"Today "
'Add the words "I woke " + currentAdverb + ". " to the currentStory -- # 2.1
currentStory
=
currentStory
+
"I woke "
+
currentAdverb
+
". "
'Add the words "Then I " + currentEdVerb + " " to the currentStory -- # 3.1
currentStory
=
currentStory
+
"Then I "
+
currentEdVerb
+
" "
'Add the words "my " + currentBodyPart + ". " to the current story -- 4.1
currentStory
=
currentStory
+
"my "
+
currentBodyPart
+
". "
'Show the currentStory in a message box as a message. -- # 1.1
MessageBox
.
ShowMessage
(
currentStory
)
Copyright (c) Microsoft Corporation. All rights reserved.