<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8961357929208576241</id><updated>2012-02-16T08:48:03.511-08:00</updated><category term='table'/><category term='lessons'/><category term='basic'/><category term='web'/><category term='programming'/><category term='runbasic'/><category term='graphics'/><category term='web development'/><category term='oop'/><category term='run basic'/><category term='goto'/><category term='learn'/><category term='logo'/><category term='form'/><category term='library'/><category term='component'/><category term='software development'/><category term='subroutines'/><category term='geometry'/><category term='pascal'/><category term='module'/><category term='object oriented'/><category term='modularity'/><category term='web programming'/><category term='qbasic'/><category term='turtle graphics'/><title type='text'>Easy Web Programming with Run BASIC</title><subtitle type='html'>Want to learn web programming with Run BASIC, the easiest web programming system around?  You've come to the right place!  Go to &lt;a href="http://www.runbasic.com"&gt;http://www.runbasic.com&lt;/a&gt; and download and install Run BASIC.  Then come back here and read the posted lessons to learn how easy web programming can be!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8961357929208576241.post-5894723362140327602</id><published>2009-01-13T19:06:00.000-08:00</published><updated>2009-01-13T19:54:31.259-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='table'/><category scheme='http://www.blogger.com/atom/ns#' term='run basic'/><title type='text'>A Simple Table - Lesson 7</title><content type='html'>Run BASIC provides an easy way to display tabular information in a web app.  The TABLE statement takes the data from an array and places it in a table with automatically aligned columns.  Here is a simple program that lets you add a row of three items at a time to an array, and then the table grows as each row is added:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;'simple table&lt;br /&gt;limit = 200&lt;br /&gt;dim locations$(2, limit)&lt;br /&gt;&lt;br /&gt;[displayAll]&lt;br /&gt;cls&lt;br /&gt;if position &lt;= limit then&lt;br /&gt;  print "Name: ";  &lt;br /&gt;  textbox #name, ""  &lt;br /&gt;  #name setfocus()&lt;br /&gt;  print " X:";&lt;br /&gt;  textbox #x, ""&lt;br /&gt;  print " Y:";&lt;br /&gt;  textbox #y, ""&lt;br /&gt;  button #add, "Add", [add]&lt;br /&gt;else&lt;br /&gt;  print "Limit reached."&lt;br /&gt;end if&lt;br /&gt;if position &gt; 0 then&lt;br /&gt;    table #t, locations$()&lt;br /&gt;    render #t&lt;br /&gt;end if&lt;br /&gt;wait&lt;br /&gt;&lt;br /&gt;[add]&lt;br /&gt;locations$(0, position) = #name contents$()&lt;br /&gt;locations$(1, position) = #x contents$()&lt;br /&gt;locations$(2, position) = #y contents$()&lt;br /&gt;position = position + 1&lt;br /&gt;goto [displayAll]&lt;/blockquote&gt;&lt;span style="font-family:times new roman;"&gt;Here is a version for the GOTO averse.  ;-)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;'simple table&lt;br /&gt;global #name, #x, #y, limit, position&lt;br /&gt;limit = 200&lt;br /&gt;dim locations$(2, limit)&lt;br /&gt;call displayAll&lt;br /&gt;wait&lt;br /&gt;&lt;br /&gt;sub displayAll&lt;br /&gt;cls&lt;br /&gt;if position &lt;= limit then&lt;br /&gt;  print "Name: ";&lt;br /&gt;  textbox #name, ""&lt;br /&gt;  #name setfocus()&lt;br /&gt;  print " X:";&lt;br /&gt;  textbox #x, ""&lt;br /&gt;  print " Y:";&lt;br /&gt;  textbox #y, ""&lt;br /&gt;  button #add, "Add", add&lt;br /&gt;else&lt;br /&gt;  print "Limit reached."&lt;br /&gt;end if&lt;br /&gt;if position &gt; 0 then&lt;br /&gt;      table #t, locations$()&lt;br /&gt;      render #t&lt;br /&gt;end if&lt;br /&gt;end sub&lt;br /&gt;&lt;br /&gt;sub add key$&lt;br /&gt;locations$(0, position) = #name contents$()&lt;br /&gt;locations$(1, position) = #x contents$()&lt;br /&gt;locations$(2, position) = #y contents$()&lt;br /&gt;position = position + 1&lt;br /&gt;call displayAll&lt;br /&gt;end sub&lt;/blockquote&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;In the next lesson we will add some visual decoration to the program.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8961357929208576241-5894723362140327602?l=easywebprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/5894723362140327602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8961357929208576241&amp;postID=5894723362140327602' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/5894723362140327602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/5894723362140327602'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/2009/01/simple-table.html' title='A Simple Table - Lesson 7'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8961357929208576241.post-922927888993727550</id><published>2009-01-12T05:31:00.001-08:00</published><updated>2009-01-12T08:27:50.790-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='modularity'/><category scheme='http://www.blogger.com/atom/ns#' term='library'/><category scheme='http://www.blogger.com/atom/ns#' term='pascal'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='object oriented'/><category scheme='http://www.blogger.com/atom/ns#' term='run basic'/><category scheme='http://www.blogger.com/atom/ns#' term='component'/><title type='text'>Module, component, object...  Whatsit?</title><content type='html'>In our last post we discussed how to create a module for reusing code that is common between different programs.  You may have noticed that we used the terms module, component, and object interchangeably.  We did this so that we could write this post.  ;-)&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The term object oriented has a bad reputation in some programming circles.  People who enjoy structured procedural languages like BASIC, Pascal, C, etc. often find objects challenging to wrap their minds around.  Run BASIC incorporates some very simple object oriented ideas and tries to present them in a non-object way.  For example you can work with files and graphics without noticing that they are objects in Run BASIC.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Creating a module like we did in the last lesson shows a simple way to leverage objects in BASIC.  Nothing fancy really.  Just create a separate program and hold onto it in a variable.  Then you can call its functions to do things.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That's really all an object is.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8961357929208576241-922927888993727550?l=easywebprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/922927888993727550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8961357929208576241&amp;postID=922927888993727550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/922927888993727550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/922927888993727550'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/2009/01/module-component-object-whatsit.html' title='Module, component, object...  Whatsit?'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8961357929208576241.post-3049622154260835820</id><published>2009-01-10T20:32:00.000-08:00</published><updated>2009-01-12T05:31:00.752-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='library'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='object oriented'/><category scheme='http://www.blogger.com/atom/ns#' term='run basic'/><category scheme='http://www.blogger.com/atom/ns#' term='component'/><category scheme='http://www.blogger.com/atom/ns#' term='oop'/><category scheme='http://www.blogger.com/atom/ns#' term='module'/><title type='text'>Making a module - Lesson 6</title><content type='html'>Many times it can be useful to break a program up into pieces.  For example the part of our hypotenuse calculator that draws a right triangle might be useful in more than one program about triangles.  Why reimplement it in each one?&lt;br /&gt;&lt;br /&gt;Run BASIC permits a program to use one or more others.  Let's take the code that draws the right triangle and make a program that can be used as a module (or object) by the hypotenuse calculator program.  Here's what that looks like:&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;'This program is a module for drawing&lt;br /&gt;'right triangles.&lt;br /&gt;wait&lt;br /&gt;&lt;br /&gt;function drawRightTriangle(a, b, c)&lt;br /&gt;cls&lt;br /&gt;graphic #rightTri, 240, 180&lt;br /&gt;#rightTri place(210, 160)&lt;br /&gt;#rightTri north()&lt;br /&gt;#rightTri go(150)&lt;br /&gt;#rightTri turn(-127)&lt;br /&gt;#rightTri go(250)&lt;br /&gt;#rightTri turn(-143)&lt;br /&gt;#rightTri go(200)&lt;br /&gt;#rightTri box(180, 130)&lt;br /&gt;#rightTri place(215, 80)&lt;br /&gt;#rightTri "\"; a&lt;br /&gt;#rightTri place(100, 170)&lt;br /&gt;#rightTri "\"; b&lt;br /&gt;#rightTri place(90, 80)&lt;br /&gt;#rightTri "\"; c&lt;br /&gt;render #rightTri&lt;br /&gt;end function&lt;br /&gt;&lt;/blockquote&gt;The idea here is that our hypotenuse calculator program will run this one which will just stop and wait to be called.  That's why the first thing in the program is a WAIT statement.  Notice also that we convert the SUB into a FUNCTION.  This is the format that Run BASIC expects when one program calls another to do some work.&lt;br /&gt;&lt;br /&gt;Here is how the hypotenuse calculator looks once we modify it to use the new right triangle drawing module:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    'hypotenuse calculator with module&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    global a, b, c, #sideA, #sideB&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    run "rightTriangle", #drawing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    call displayAll&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    wait&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    sub displayAll&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    cls&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    print "Hypotenuse Calculator"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    print "Length of side A: ";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    textbox #sideA, a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    print "Length of side B: ";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    textbox #sideB, b&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    button #go, "Go!", computeSideC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    if c &gt; 0 then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    print "Length of side C: "; c&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    #drawing drawRightTriangle(a, b, c)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    render #drawing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    end if&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    end sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    sub computeSideC key$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    a = #sideA value()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    b = #sideB value()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    c = sqr(a^2+b^2)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    call displayAll&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    end sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;See how at the beginning of the program we use a RUN statement to start up a copy of the rightTriangle program?  Then we assign it to an object variable named #drawing.&lt;br /&gt;&lt;br /&gt;Inside our displayAll subroutine we no longer use CALL to access the drawRightTriangle subroutine because it doesn't exist in our program anymore.  Instead we invoke the drawRightTriangle() function on the #drawing object using the form:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;#drawing drawRightTriangle(a, b, c)&lt;/span&gt;&lt;/blockquote&gt;Then once the drawRightTriangle() function is finished we render the #drawing object like so:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;render #drawing&lt;/span&gt;&lt;/blockquote&gt;Wait a minute... you say.  We already have a RENDER statement in the rightTriangle program.  Why do we need another?  Good question.  Any time you RUN a program from within another and you want the newly RUN program to appear you must render it.  So in this case you're not rendering the GRAPHIC object but the whole rightTriangle program is being rendered as part of the page.  The RENDER statement in the rightTriangle program just renders the GRAPHIC.  So both RENDER statements are needed.&lt;br /&gt;&lt;br /&gt;Whew!  That was a mouthful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8961357929208576241-3049622154260835820?l=easywebprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/3049622154260835820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8961357929208576241&amp;postID=3049622154260835820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/3049622154260835820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/3049622154260835820'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/2009/01/making-module-lesson-6.html' title='Making a module - Lesson 6'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8961357929208576241.post-1077846588415968209</id><published>2009-01-07T19:59:00.000-08:00</published><updated>2009-01-07T20:14:07.747-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='turtle graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='geometry'/><title type='text'>Turtle graphics - Lesson 5</title><content type='html'>Let's draw some graphics that we can use with our hypotenuse calculator.  Let's draw one of those standard right triangles and then draw values for each side.  To do this let's use turtle graphics (&lt;a href="http://en.wikipedia.org/wiki/Turtle_graphics"&gt;here's a Wikipedia entry for turtle graphics&lt;/a&gt;).  The Run BASIC graphic object has a turtle which you can command by telling it to turn and go on the graphic area.  As you command it to go and turn it draws lines showing where it's been.&lt;br /&gt;&lt;br /&gt;Examine the drawRightTriangle subroutine to see how we draw the triangle, the little box at the 90 degree corner, and the lengths of each side.&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;'hypotenuse calculator&lt;br /&gt;global a, b, c, #sideA, #sideB&lt;br /&gt;call displayAll&lt;br /&gt;wait&lt;br /&gt;&lt;br /&gt;sub displayAll&lt;br /&gt;cls&lt;br /&gt;print "Hypotenuse Calculator"&lt;br /&gt;print&lt;br /&gt;print "Length of side A: ";&lt;br /&gt;textbox #sideA, a&lt;br /&gt;print&lt;br /&gt;print "Length of side B: ";&lt;br /&gt;textbox #sideB, b&lt;br /&gt;print&lt;br /&gt;button #go, "Go!", computeSideC&lt;br /&gt;print&lt;br /&gt;if c &gt; 0 then&lt;br /&gt;  print "Length of side C: "; c&lt;br /&gt;  call drawRightTriangle a, b, c&lt;br /&gt;end if&lt;br /&gt;end sub&lt;br /&gt;&lt;br /&gt;sub computeSideC key$&lt;br /&gt;a = #sideA value()&lt;br /&gt;b = #sideB value()&lt;br /&gt;c = sqr(a^2+b^2)&lt;br /&gt;call displayAll&lt;br /&gt;end sub&lt;br /&gt;&lt;br /&gt;sub drawRightTriangle a, b, c&lt;br /&gt;  graphic #rightTri, 240, 180&lt;br /&gt;  #rightTri place(210, 160)&lt;br /&gt;  #rightTri north()&lt;br /&gt;  #rightTri go(150)&lt;br /&gt;  #rightTri turn(-127)&lt;br /&gt;  #rightTri go(250)&lt;br /&gt;  #rightTri turn(-143)&lt;br /&gt;  #rightTri go(200)&lt;br /&gt;  #rightTri box(180, 130)&lt;br /&gt;  #rightTri place(215, 80)&lt;br /&gt;  #rightTri "\"; a&lt;br /&gt;  #rightTri place(100, 170)&lt;br /&gt;  #rightTri "\"; b&lt;br /&gt;  #rightTri place(90, 80)&lt;br /&gt;  #rightTri "\"; c&lt;br /&gt;  render #rightTri&lt;br /&gt;end sub&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/blockquote&gt;Here's what the drawing looks like:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_PwEAHwoeorE/SWV8qLtN_KI/AAAAAAAAAAw/pI49M9cSTug/s1600-h/316E6F8.png"&gt;&lt;img style="cursor: pointer; width: 307px; height: 230px;" src="http://1.bp.blogspot.com/_PwEAHwoeorE/SWV8qLtN_KI/AAAAAAAAAAw/pI49M9cSTug/s200/316E6F8.png" alt="" id="BLOGGER_PHOTO_ID_5288770401555315874" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8961357929208576241-1077846588415968209?l=easywebprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/1077846588415968209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8961357929208576241&amp;postID=1077846588415968209' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/1077846588415968209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/1077846588415968209'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/2009/01/turtle-graphics-lesson-5.html' title='Turtle graphics - Lesson 5'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PwEAHwoeorE/SWV8qLtN_KI/AAAAAAAAAAw/pI49M9cSTug/s72-c/316E6F8.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8961357929208576241.post-4049155922939595542</id><published>2009-01-05T18:57:00.001-08:00</published><updated>2009-01-12T05:26:28.221-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qbasic'/><category scheme='http://www.blogger.com/atom/ns#' term='turtle graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='logo'/><category scheme='http://www.blogger.com/atom/ns#' term='runbasic'/><title type='text'>Drawing Graphics - Lesson 4</title><content type='html'>Drawing graphics is a powerful and fun feature of programming languages, and Run BASIC makes it easy to do this in a web application.&lt;br /&gt;&lt;br /&gt;To do this we use the GRAPHIC statement to create a graphical object. Then we call methods on that object. The term 'method' is another way of saying a function that is tied to a kind of object. Once we've drawn something we can tell Run BASIC to embed the graphic into the web page by using the RENDER statement.&lt;br /&gt;&lt;br /&gt;Here is a very simple Run BASIC program that draws a graphic.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;'draw a graphic 200 by 200&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;graphic #pattern, 200, 200&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;for x = 0 to 200 step 10&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#pattern line(x, 0, 0, 200-x)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#pattern line(0, x, x, 200)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#pattern line(x, 0, 200, x)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#pattern line(x, 200, 200, 200-x)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;next x&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;render #pattern&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Here is what the drawn graphic looks like!&lt;/p&gt;&lt;a href="http://1.bp.blogspot.com/_PwEAHwoeorE/SWLMe0e178I/AAAAAAAAAAo/WZz1KOWodXU/s1600-h/pattern.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5288013742342533058" style="WIDTH: 200px; CURSOR: hand; HEIGHT: 200px" alt="" src="http://1.bp.blogspot.com/_PwEAHwoeorE/SWLMe0e178I/AAAAAAAAAAo/WZz1KOWodXU/s200/pattern.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next lesson we will add a graphical drawing to our hypotenuse calculator.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8961357929208576241-4049155922939595542?l=easywebprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/4049155922939595542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8961357929208576241&amp;postID=4049155922939595542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/4049155922939595542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/4049155922939595542'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/2009/01/drawing-graphics-lesson-4.html' title='Drawing Graphics - Lesson 4'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_PwEAHwoeorE/SWLMe0e178I/AAAAAAAAAAo/WZz1KOWodXU/s72-c/pattern.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8961357929208576241.post-1416038994053831810</id><published>2009-01-04T19:12:00.000-08:00</published><updated>2009-01-05T18:56:05.069-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='lessons'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='goto'/><category scheme='http://www.blogger.com/atom/ns#' term='subroutines'/><title type='text'>Using Subroutines - Lesson 3</title><content type='html'>The first two lessons show how to write old style BASIC programs which use GOTO. Let's show how to create the hypotenuse calculator in a more structured way using scoped subroutines. Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;'hypotenuse calculator&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;global a, b, c, #sideA, #sideB&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;call displayAll&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;wait&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sub displayAll&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;cls&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print "Hypotenuse Calculator"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print "Length of side A: "; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;textbox #sideA, a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print "Length of side B: ";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;textbox #sideB, b&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;button #go, "Go!", computeSideC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if c &gt; 0 then print "Length of side C: "; c&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sub computeSideC key$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;a = #sideA value()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;b = #sideB value()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;c = sqr(a^2+b^2)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;call displayAll&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end sub&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;If you compare this example to the one for lesson 2, you'll see most of the code is the same.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The first few lines of code kick the program off by calling the displayAll subroutine.&lt;/li&gt;&lt;li&gt;The displayAll subroutine adds a button which calls the computeSideC subroutine when it is clicked.&lt;/li&gt;&lt;li&gt;The computeSideC subroutine does some math and then calls the displayAll subroutine, forcing the web page to update. &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8961357929208576241-1416038994053831810?l=easywebprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/1416038994053831810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8961357929208576241&amp;postID=1416038994053831810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/1416038994053831810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/1416038994053831810'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/2009/01/using-subroutines-lesson-3.html' title='Using Subroutines - Lesson 3'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8961357929208576241.post-7060015185394270046</id><published>2009-01-02T10:15:00.000-08:00</published><updated>2009-01-04T19:26:48.119-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='learn'/><category scheme='http://www.blogger.com/atom/ns#' term='form'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><title type='text'>Creating a Web Form - Lesson 2</title><content type='html'>Let's take the simple interactive hypotenuse calculator from the previous post and create a version of it that has a couple of fields and a button to do the computation:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;[displayAll]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;cls&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print "Hypotenuse Calculator"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print "Length of side A: "; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;textbox #sideA, a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print "Length of side B: ";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;textbox #sideB, b&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;button #go, "Go!", [go]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if c &gt; 0 then print "Length of side C: "; c&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;wait&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;[go]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;a = #sideA value()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;b = #sideB value()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;c = sqr(a^2+b^2)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;goto [displayAll]&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;The first part of the program clears the web page using the CLS statement. Then it adds labels and entry fields using the PRINT and TEXTBOX statements.&lt;br /&gt;&lt;br /&gt;Then the BUTTON statement adds a button that will use the code at the [go] label to compute the length of the C side.&lt;br /&gt;&lt;br /&gt;Notice the IF THEN statement after the BUTTON statment. If the length of C is greater than zero then that means we have computed at least once, so print the result on the web page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8961357929208576241-7060015185394270046?l=easywebprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/7060015185394270046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8961357929208576241&amp;postID=7060015185394270046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/7060015185394270046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/7060015185394270046'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/2009/01/creating-form.html' title='Creating a Web Form - Lesson 2'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8961357929208576241.post-86878665501793759</id><published>2009-01-01T14:14:00.000-08:00</published><updated>2009-01-04T19:27:06.137-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qbasic'/><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='learn'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='run basic'/><title type='text'>A Simple Interactive Web Application - Lesson 1</title><content type='html'>One thing that Run BASIC does better than most other web programming systems is interactive applications where a program asks the user for a piece of information at a time and produces answers as you go. This is the way a lot of non-web applications work but it is hard to create these kinds of apps using conventional web programming.&lt;br /&gt;&lt;br /&gt;Here is Run BASIC source code for a simple web application that computes the length of a hypotenuse for a right triangle if the length of the other two sides are known.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;[startHere]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;print "Hypotenuse Calculator"&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;print&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;input "Length of side A"; a&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;input "Length of side B"; b&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;c = sqr(a^2+b^2)&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;print "Length of hypotenuse (side C) = "; c&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;print&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;input "Compute another (Y/N)"; yn$&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;if yn$ = "Y" or yn$ = "y" then&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;cls&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;goto [startHere]&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;end if&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;print "Goodbye."&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;end&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;If you're completely new to web programming you may not realize that the above code doesn't look like code for a web app. In fact it looks very much like code for a QBasic program. If you're an experienced web programmer you may be scratching your head because it looks too simplistic to be a web program, but it is a web program.&lt;br /&gt;&lt;br /&gt;Run BASIC does its best to hide the hard stuff that most web programming systems force the programmer to deal with. If you really must use some special web development technique Run BASIC provides ways to do that too and we'll cover some of these in later posts. Most of the time it isn't necessary because Run BASIC does the heavy lifting for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8961357929208576241-86878665501793759?l=easywebprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/86878665501793759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8961357929208576241&amp;postID=86878665501793759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/86878665501793759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/86878665501793759'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/2009/01/simple-interactive-web-application.html' title='A Simple Interactive Web Application - Lesson 1'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8961357929208576241.post-8466214050727537076</id><published>2008-12-27T12:07:00.001-08:00</published><updated>2008-12-27T12:09:29.492-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web development'/><category scheme='http://www.blogger.com/atom/ns#' term='web programming'/><category scheme='http://www.blogger.com/atom/ns#' term='software development'/><category scheme='http://www.blogger.com/atom/ns#' term='lessons'/><category scheme='http://www.blogger.com/atom/ns#' term='learn'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><category scheme='http://www.blogger.com/atom/ns#' term='run basic'/><title type='text'>Web Programming without Web Programming</title><content type='html'>This blog will include short lessons that show how to do many different things in &lt;a href="http://www.runbasic.com/"&gt;Run BASIC&lt;/a&gt;, a web programming so easy that it's fair to call it "Web Programming without Web Programming."  I call it this because web programming is hard, but Run BASIC is not hard.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8961357929208576241-8466214050727537076?l=easywebprogramming.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://easywebprogramming.blogspot.com/feeds/8466214050727537076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8961357929208576241&amp;postID=8466214050727537076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/8466214050727537076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8961357929208576241/posts/default/8466214050727537076'/><link rel='alternate' type='text/html' href='http://easywebprogramming.blogspot.com/2008/12/web-programming-without-web-programming.html' title='Web Programming without Web Programming'/><author><name>Carl Gundel</name><uri>http://www.blogger.com/profile/02824706988216699282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
