View Single Post
  #2828  
Old July 28th, 2004, 12:51 PM
David E. Gervais's Avatar

David E. Gervais David E. Gervais is offline
General
 
Join Date: May 2002
Location: Canada
Posts: 3,227
Thanks: 7
Thanked 44 Times in 28 Posts
David E. Gervais is on a distinguished road
Default Re: STM "Final v1.7.5" Discussion

Quote:
Originally posted by narf poit chez BOOM:
2: PRINT "HELLO WORLD"
RUN
HELLO WORLD

For some reason, that seemed amazingly satisfying.
..Warning,.. Thread Hijack!..

Narf that was a good example of bad programming.. Try this,..

10 REM This is my first program
20 STR$ = "Hello World"
30 REM I just set the value of the string I want to print to the screen
40 COLOR 255, 0, 0; SETCOLOR 255, 255, 255
50 REM I just set the Screen color to RED and Text to White
60 CLEAR SCREEN
70 REM I got rid of all the junk on my screen
80 POSITION ((SCR_WIDTH / 2) - (LEN STR$ / 2)), (SCR_HEIGHT /2)
90 REM I centered the text cursor
100 PRINT STR$

RUN
>

..What? where did my text go? I saw it flash for a nanosecond but it dissapeared.. I'll have to debug,..

10 REM This is my second attempt at a program
20 STR$ = "Hello World"
30 REM I just set the value of the string I want to print to the screen
40 COLOR 255, 0, 0; SETCOLOR 255, 255, 255
50 REM I just set the Screen color to RED and Text to White
60 CLEAR SCREEN
70 REM I got rid of all the junk on my screen
80 POSITION ((SCR_WIDTH / 2) - (LEN STR$ / 2)), (SCR_HEIGHT /2)
90 REM I centered the text cursor
100 PRINT STR$
105 DO WHILE INKEY$ = ""
110 REM See this looks much better right?

RUN
Hello World!


(Now press any key to get back to the regular topic of this thread. )

NOTE: (Program output is 'simulated' Actual output would have a red screen with white text.)

Cheers!
Reply With Quote