Anybody remember basic

Associate
Joined
8 Jan 2009
Posts
1,492
Location
Northern Ireland
I have a few errors in lines, 7,59 8,3 26,1 28,3 and 24,17. cant figure them out. You can download the Basic program language from Microsoft HERE free.

Code:
First=1
Last=100

TextWindow.Clear()
For Celsius=First To Last
  Fahrenheit=(9/5)* Celsius+32
  TextWindow. WriteLine(Celsius+"degreesC is"+Farhrenheit+"degreesF is"
  Endfo
  While URL=""
    TextWindow.Clear()
    TextWindow. Write("What should I search Flickr for?")
    Tag=TextWindow.Read()
    URL=Flickr.GetRandomPicture(Tag)
  EndWhile
  Desktop.SetWallPaper(URL)
  GraphicsWindow. BackgroundColor="White"
  GraphicsWindow.PenColor="Green"
  GraphicsWindow.Width=480
  For i= 0 To 6.4 step 0.17
  x = Math.Sin(i)*100+180
  y = Math.Cos(i)*100+160
  GraphicsWindow.DrawEllipse(x,y,120,120)
EndFor
GraphicsWindow. MouseDown=OnMouseDown
GraphicsWindow. MouseMove=OnMouseMove
 Sub OnMouseDown
  GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
  EndSub
  Sub OnMouseMove
    If Mouse.IsLeftButtonDown Then 
      x=GraphicsWindow.MouseX-6
      y=GraphicsWindow.MouseY-6
      GraphicsWindow.FillEllipse(x,y,12,12)
      EndIf
      EndSub
 
Last edited:
Line 7: You have TextWindow. WriteLine which should be TextWindow.WriteLine (no space)
Line 7: You've also got +Farhrenheit+ but your variable name is Fahrenheit, so that won't work
Line 8: You have Endfo instead of EndFor
Line 16: GraphicsWindow. BackgroundColor needs to have the space removed
Line 24: GraphicsWindow. MouseDown=OnMouseDown needs to have the space removed
Line 25: GraphicsWindow. MouseMove=OnMouseMove needs to have the space removed

That's just what I can see. Could you provide the specific error messages that you're getting for each line?
 
Last edited:
Line 7: You have TextWindow. WriteLine which should be TextWindow.WriteLine (no space)
Line 7: You've also got +Farhrenheit+ but your variable name is Fahrenheit, so that won't work
Line 8: You have Endfo instead of EndFor
Line 16: GraphicsWindow. BackgroundColor needs to have the space removed
Line 24: GraphicsWindow. MouseDown=OnMouseDown needs to have the space removed
Line 25: GraphicsWindow. MouseMove=OnMouseMove needs to have the space removed

That's just what I can see. Could you provide the specific error messages that you're getting for each line?

You didn't close your parenthesis ")".

Thanks for that, I'm a bit behind, haven't done Basic for a number of years. I In fact, Microsoft would have a copy of Basic on all it's OS's.
 
Its just me - but I always code in a failsafe for while loops, so just incase URL is never populated with a value I would add some code in While URL="" to handle the situation - probably a localised timer that broke the loop - either with an error or some conditional code - if it sat in the while loop too long.
 
Back
Top Bottom