Microsoft Small Basic

Program Listing:
Embed this in your website
'Project State Banner - Norway
'http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/5a871218-3aaf-4e07-8ede-a934d45040c2
GraphicsWindow.Show()
h = GraphicsWindow.Height
mh = Math.Floor(h / 2)
w = GraphicsWindow.Width
mw = Math.Floor(w / 2)
red = "#EF2B2D"   'PMS 032 U
blue = "#002868"  'PMS 281 U
scale = 5
translation = "poetic"
If translation = "literal" Then
  english = "1=Yes we love this country as it rises forth,;2=rugged, weathered, above the sea, with the thousands of homes.;3=Love, love it and think of our father and mother;4=and the saga night that sends dreams to our earth (x2);"
ElseIf translation = "poetic" Then
  english = "1=Yes, we love with fond devotion. This our land that looms.;2=Rugged, storm-scarred o'er the ocean. With her thousand homes.;3=Love her, in our love recalling. Those who gave us birth.;4=And old tales which night, in falling, Brings as dreams to earth. (x2);"
ElseIf translation = "metrical" Then
  english = "1=Norway, thine is our devotion, Land of hearth and home,;2=Rising storm-scarr'd from the ocean, Where the breakers foam.;3=Oft to thee our thoughts are wending, Land that gave us birth,;4=And to saga nights still sending dreams upon us on our earth (x2);"
EndIf
drawFlag()
Sub drawFlag
lcx = mw - 11*scale 'Left corners x
rcx = mw - 1*scale  'Right corners x
ucy = mh - 8*scale  'Upper corners y
lcy = mh + 2*scale  'Lower corners y
vcx = mw - 4*scale  'Vertical part of the cross x
vcy = mh - 8*scale  'Vertical part of the cross y
hcx = mw - 11*scale 'Horizontal part of the cross x
hcy = mh - 1*scale  'Horizontal part of the cross y
GraphicsWindow.BrushColor = red
GraphicsWindow.PenColor = red
UpperLeftCorner = Shapes.AddRectangle(6*scale, 6*scale)
Shapes.HideShape(UpperLeftCorner)
LowerLeftCorner = Shapes.AddRectangle(6*scale, 6*scale)
Shapes.HideShape(LowerLeftCorner)
UpperRightCorner = Shapes.AddRectangle(12*scale, 6*scale)
Shapes.HideShape(UpperRightCorner)
LowerRightCorner = Shapes.AddRectangle(12*scale, 6*scale)
Shapes.HideShape(LowerRightCorner)
GraphicsWindow.BrushColor = blue
GraphicsWindow.PenColor = blue
VerticalCross = Shapes.AddRectangle(2*scale, 16*scale)
Shapes.HideShape(VerticalCross)
HorizontalCross = Shapes.AddRectangle(22*scale, 2*scale)
Shapes.HideShape(HorizontalCross)
Shapes.Move(UpperLeftCorner, lcx, ucy)
Shapes.Move(LowerLeftCorner, lcx, lcy)
Shapes.Move(UpperRightCorner, rcx, ucy)
Shapes.Move(LowerRightCorner, rcx, lcy)
Shapes.Move(VerticalCross, vcx, vcy)
Shapes.Move(HorizontalCross, hcx, hcy)
Shapes.ShowShape(UpperLeftCorner)
Shapes.ShowShape(LowerLeftCorner)
Shapes.ShowShape(UpperRightCorner)
Shapes.ShowShape(LowerRightCorner)
Shapes.ShowShape(VerticalCross)
Shapes.ShowShape(HorizontalCross)
EndSub
GraphicsWindow.BrushColor = "Black"
lyric = Shapes.AddText("")
englishlyric = Shapes.AddText("")
Shapes.Move(englishlyric, 0, 12)
Program.Delay(100)
Shapes.SetText(lyric, "Ja, vi elsker dette landet, som det stiger frem,")
Shapes.SetText(englishlyric, english[1])
Sound.PlayMusic("O4 F4 R8 E-8 D4 C4 O3 B-4 O4 C4 D4 E-4 F4 R8 G8 F4 E-4 D2 R4 R4")
Shapes.SetText(lyric, "furet, værbitt over vannet, med de tusen hjem.")
Shapes.SetText(englishlyric, english[2])
Sound.PlayMusic("G4 R8 F8 E-4 D4 C4 D4 E-4 F4 F4 R8 G8 G4 A4 B-2 R4 R4")
Shapes.SetText(lyric, "Elsker, elsker det og tenker på vår far og mor")
Shapes.SetText(englishlyric, english[3])
Sound.PlayMusic("B-4 R8 B-8 A8 R16 A16 G8 R16 G16 F2 D2 G4 R8 G8 F4 F4 E-2 R4")
Shapes.SetText(lyric, "og den saganatt som senker drømmer på vår jord. (x2)")    'Note: "senker" is repeated twice second time
Shapes.SetText(englishlyric, english[4])
Sound.PlayMusic("F8 R16 F16 F4 G4 G4 A4 A2 B-2 B-4 R8 B-8 A4 B-4 O5 C2 R4 C8 R16 C16 C4 D4 E-4 D4 C2 O4 B-4 A8 R16 G16 F4 R8 G8 G4 A4 B-2 R4 R4")
For percentage = 99 To 0 Step -1
  Shapes.SetOpacity(lyric, percentage)
  Shapes.SetOpacity(englishlyric, percentage)
  Program.Delay(20)
EndFor
scale = 30
removeShapes()
drawFlag()
Sub removeShapes
  Shapes.Remove(UpperLeftCorner)
  Shapes.Remove(LowerLeftCorner)
  Shapes.Remove(UpperRightCorner)
  Shapes.Remove(LowerRightCorner)
  Shapes.Remove(VerticalCross)
  Shapes.Remove(HorizontalCross)
EndSub
Copyright (c) Microsoft Corporation. All rights reserved.