<?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-2465258041713689505</id><updated>2011-12-27T05:47:28.829-08:00</updated><category term='rox'/><category term='mirrors'/><category term='puppybasic'/><category term='packages'/><category term='fvwm95'/><category term='jwm'/><category term='rxvt'/><category term='wiki'/><category term='pager'/><category term='icons'/><category term='documentation'/><category term='2.13'/><category term='bugs'/><category term='2.11'/><category term='howto'/><category term='24hr'/><category term='forums'/><category term='blinky'/><category term='2.12'/><category term='12hr'/><category term='post'/><category term='bash'/><category term='upgrade'/><category term='blog'/><category term='mtpaint'/><category term='leafpad'/><category term='taskbar'/><category term='1.07'/><category term='pupweb'/><category term='editor'/><category term='downloads'/><category term='desktop'/><category term='clock'/><category term='software'/><category term='browser'/><category term='pupwin98'/><category term='another'/><category term='distros'/><category term='podcasts'/><category term='dos'/><category term='screenshot'/><category term='pawedcasts'/><category term='default'/><category term='dillo'/><title type='text'>puppylinux documentation blog (node 01)</title><subtitle type='html'>an idiot-friendly way to contribute and find info on puppy!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2465258041713689505.post-4865298950546130264</id><published>2007-02-03T10:05:00.000-08:00</published><updated>2007-02-03T10:56:55.878-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='icons'/><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><category scheme='http://www.blogger.com/atom/ns#' term='desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='mtpaint'/><title type='text'>howto change the desktop icons</title><content type='html'>to change an icon right click and "set icon." to set the icon, drag the desired image from the icons folder (most are in /usr/local/lib/X11/pixmaps or /usr/local/lib/X11/mini-icons) right onto the box in the middle if the set icon window- typing is optional!&lt;br /&gt;&lt;br /&gt;to create an icon, drag the script or binary for it (this may be the only needed step...) from /usr/local/bin (or any other folder) right onto the desktop.&lt;br /&gt;&lt;br /&gt;to edit an icon image, goto the icons folder from mtpaint and open it, or goto the icons folder in rox and right click... "open with" and open it it mtpaint. (the second method may not always work.) &lt;br /&gt;&lt;br /&gt;you can zoom in on your image by pressing "7" on your keyboard, or other numbers, nothing that "4" will go back to regular size. &lt;br /&gt;&lt;br /&gt;most icons are xpm or png, you can use the "transparent" color by selecting from the background with [CTRL]+Paint tool, or you can set a new background color by selecting "save as..." from the mtpaint menu, checking "set transparancy index" and selecting the number next to the new color in the palette. you may need to "convert to indexed" from the "image" menu, but you probably won't. &lt;br /&gt;&lt;br /&gt;after saving the image to the same file you loaded it from, the icon on the desktop will refresh after you hover the mouse cursor over it, if not sooner.&lt;br /&gt;&lt;br /&gt;ktwi: puppy 2.11, *should* work also in 1.07 and most (or all) other versions...&lt;br /&gt;&lt;br /&gt;thanks to: amish&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-4865298950546130264?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/4865298950546130264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=4865298950546130264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/4865298950546130264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/4865298950546130264'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/howto-change-desktop-icons.html' title='howto change the desktop icons'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-6173203532569984080</id><published>2007-02-02T15:52:00.000-08:00</published><updated>2007-02-03T07:13:32.066-08:00</updated><title type='text'>puppybasic intro ch. 17 - other useful statements</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;other useful statements                                                  &lt;br /&gt;1 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 17: other useful statements                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;other useful statements                                                  &lt;br /&gt;2 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;SHELL calls a dos command. dos of course, is not only capable of         &lt;br /&gt;managing operations with files and folders, it can call other pieces     &lt;br /&gt;of software. running large programs from shell may result in an "out     &lt;br /&gt;of memory" error from dos. (usually not an issue.)                       &lt;br /&gt;                                                                         &lt;br /&gt;here's a nice example for SHELL:                                         &lt;br /&gt;SHELL "dir *.* /a /b &gt; dirfile.txt"                                      &lt;br /&gt;                                                                         &lt;br /&gt;this creates a file called "dirfile.txt" containing a list of all        &lt;br /&gt;files in the current folder. then you can load the list with the OPEN    &lt;br /&gt;command.                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;other useful statements                                                  &lt;br /&gt;3 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;mode co40 is another useful dos command, but doesn't always (if ever)    &lt;br /&gt;work in windows xp. (for some reason, every time windows makes a new     &lt;br /&gt;dos emulator it does even less of the stuff that dos or the previous     &lt;br /&gt;dos emulator did.)                                                       &lt;br /&gt;                                                                         &lt;br /&gt;it is better still to use mode con cols=40, which works in xp and can    &lt;br /&gt;be used in puppybasic like this:                                             &lt;br /&gt;                                                                         &lt;br /&gt;SHELL "mode con cols=40"                                                 &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;other useful statements                                                  &lt;br /&gt;4 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;this is better than width 40, as it's more likely to work. i knew of     &lt;br /&gt;one project that wouldn't stay in WIDTH 40 unless you first shelled to   &lt;br /&gt;run this dos command, then used WIDTH 40 as well.                        &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;other useful statements                                                  &lt;br /&gt;5 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;COMMAND$                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;quickbasic (compiler) only. reads the arguments typed next to            &lt;br /&gt;a standalone exe's name, from dos or windows, so if your compiled        &lt;br /&gt;program was called appli01.exe and you were to type:                     &lt;br /&gt;                                                                         &lt;br /&gt;c:\winnt\&gt;appli01 New.txt /fs                                            &lt;br /&gt;at the dos prompt (for instance) and you put this at the beginning of    &lt;br /&gt;your program:                                                            &lt;br /&gt;                                                                         &lt;br /&gt;q$=COMMAND$  'then the string q$ would contain: "New.txt /fs"            &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;other useful statements                                                  &lt;br /&gt;6 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;SYSTEM                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;use this instead of END, this is only useful when using the              &lt;br /&gt;interpreter. it ends the program, but if the      &lt;br /&gt;interpreter is running, exits the interpreter also.    &lt;br /&gt;this only works if you've run a program using /run        &lt;br /&gt;[file].bas or /run file... etc. (from a script for instance.)     &lt;br /&gt;                                                                         &lt;br /&gt;an example:                                                              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;other useful statements                                                  &lt;br /&gt;7 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;SYSTEM                                                                   &lt;br /&gt;END 'you don't need END here, but it hurts nothing and is easy to spot   &lt;br /&gt;'when other people are reading your code.                                &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 17 =-                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                      (chapter 17) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-6173203532569984080?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/6173203532569984080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=6173203532569984080' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/6173203532569984080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/6173203532569984080'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-17.html' title='puppybasic intro ch. 17 - other useful statements'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-3506713509891348891</id><published>2007-02-02T15:50:00.000-08:00</published><updated>2007-02-03T07:10:53.322-08:00</updated><title type='text'>puppybasic intro ch. 16 - arrays</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;arrays                                                                   &lt;br /&gt;1 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 16: arrays                                     &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;arrays                                                                   &lt;br /&gt;2 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;arrays make variables more useful and offer a powerful way to handle     &lt;br /&gt;data. for instance: instead of the following code:                       &lt;br /&gt;                                                                         &lt;br /&gt;READ a                                                                   &lt;br /&gt;READ b                                                                   &lt;br /&gt;READ c                                                                   &lt;br /&gt;READ d                                                                   &lt;br /&gt;READ e: PRINT a;b;c;d;e;                                                 &lt;br /&gt;                                                                         &lt;br /&gt;DATA 52,21,19,45,73                                                      &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;arrays                                                                   &lt;br /&gt;3 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;you could replace it with this:                                          &lt;br /&gt;FOR q=1 TO 5                                                             &lt;br /&gt;READ ab(q)                                                               &lt;br /&gt;NEXT q                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;FOR q=1 TO 5                                                             &lt;br /&gt;? ab(q);                                                                 &lt;br /&gt;NEXT q                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;...which seems unspectacular until you have a bit more than five         &lt;br /&gt;variables to name.                                                       &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;arrays                                                                   &lt;br /&gt;4 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;another advantage of arrays is that you don't need to know exactly how   &lt;br /&gt;many items you will be storing. for instance:                            &lt;br /&gt;                                                                         &lt;br /&gt;DIM q$(1 to 100)                                                         &lt;br /&gt;                                                                         &lt;br /&gt;OPEN "file" FOR INPUT AS #1                                              &lt;br /&gt;DO: c=c+1                                                                &lt;br /&gt;LINE INPUT #1, q$(c)                                                     &lt;br /&gt;LOOP UNTIL EOF(1) or c =&gt; 99                                             &lt;br /&gt;                                                                         &lt;br /&gt;q$(c+1) = CHR$(26): c=0: close                                           &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;arrays                                                                   &lt;br /&gt;5 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;will open "file" and store each line in q$(c), c standing for which line &lt;br /&gt;is stored there. this example limits the possible number of lines to 99, &lt;br /&gt;and sets the last line to ascii 26 to mark it as the last.               &lt;br /&gt;                                                                         &lt;br /&gt;note the use of DIM(1 to 100) which is required for arrays more than 10  &lt;br /&gt;units in size. it is also necessary to use dim for multidimensional      &lt;br /&gt;arrays:                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;arrays                                                                   &lt;br /&gt;6 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;DIM twod(1 to 5, 1 to 5) AS INTEGER 'integers let you use wider arrays   &lt;br /&gt;                                                                         &lt;br /&gt;will allocate an array of 5 units, and each unit will also have 5        &lt;br /&gt;subunits:                                                                &lt;br /&gt;                                                                         &lt;br /&gt;twod(1,1) twod(2,1) twod(3,1) twod(4,1) twod(5,1)                        &lt;br /&gt;twod(1,2) twod(2,2) twod(3,2) twod(4,2) twod(5,2)                        &lt;br /&gt;twod(1,3) twod(2,3) twod(3,3) twod(4,3) twod(5,3)                        &lt;br /&gt;twod(1,4) twod(2,4) twod(3,4) twod(4,4) twod(5,4)                        &lt;br /&gt;twod(1,5) twod(2,5) twod(3,5) twod(4,5) twod(5,5)                        &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;arrays                                                                   &lt;br /&gt;7 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;you may find that although 3-dimensional arrays are possible, but that  &lt;br /&gt;the limitations won't allow a 3d array large enough to be useful all     &lt;br /&gt;that often. (i do know someone who used one for a card game, and you may &lt;br /&gt;be able to use one for a program to solve rubik's cube... although such  &lt;br /&gt;a program already exists.)                                               &lt;br /&gt;                                                                         &lt;br /&gt;incidently, puppybasic tends to demand that most DIM statements come at  &lt;br /&gt;the beginning of a program, but you can change the limits of some arrays     &lt;br /&gt;using REDIM.                                                             &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 16 =-                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                      (chapter 16) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-3506713509891348891?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/3506713509891348891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=3506713509891348891' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/3506713509891348891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/3506713509891348891'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-16.html' title='puppybasic intro ch. 16 - arrays'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-8896455975327323360</id><published>2007-02-02T15:49:00.000-08:00</published><updated>2007-02-03T07:07:41.826-08:00</updated><title type='text'>puppybasic intro ch. 15 - timing</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;timing                                                                   &lt;br /&gt;1 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 15: timing                                     &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;timing                                                                   &lt;br /&gt;2 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;vital to graphics and games, and useful for many other things you'll     &lt;br /&gt;want to do, the following are common functions for accessing the         &lt;br /&gt;timer inside the computer and its clock functions:                       &lt;br /&gt;                                                                         &lt;br /&gt;TIMER                                                                    &lt;br /&gt;(mentioned earlier for use with RANDOMIZE) is a numeric function that    &lt;br /&gt;returns the number of seconds that have elapsed since midnight.          &lt;br /&gt;                                                                         &lt;br /&gt;you can code a delay using TIMER this way...                             &lt;br /&gt;                                                                         &lt;br /&gt;                               ... (only joking, it's on the next page.) &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;timing                                                                   &lt;br /&gt;3 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;delay = .5 'delay in seconds, in this case: half of one second           &lt;br /&gt;t = TIMER + delay: DO: LOOP UNTIL TIMER &gt; t or TIMER &lt; t - delay * 1.2   &lt;br /&gt;                                                                         &lt;br /&gt;it is also possible to create a short delay using FOR q=1 TO d: NEXT q   &lt;br /&gt;where d is a large number, but the faster computers get, the more        &lt;br /&gt;useless this method becomes. also it is unreliable in that the delay is  &lt;br /&gt;longer on slower machines, and that the delay it creates can't be        &lt;br /&gt;determined exactly on any machine but the one you try it on.             &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;timing                                                                   &lt;br /&gt;4 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;SLEEP                                                                    &lt;br /&gt;                                                                         &lt;br /&gt;makes a program suddenly sit and do absolutely nothing until a key is    &lt;br /&gt;pressed, and if used with a number:                                      &lt;br /&gt;                                                                         &lt;br /&gt;SLEEP 5                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;works the same way, only gives up waiting for a key after that number of &lt;br /&gt;seconds.                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;timing                                                                   &lt;br /&gt;5 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;if used enough times in a program, (especially in a loop,) the keyboard  &lt;br /&gt;buffer will fill, which adds up to annoying clicking noises. you can     &lt;br /&gt;clear this buffer using INKEY$, but i think it makes more sense to       &lt;br /&gt;substitute q$=INPUT$(1) for SLEEP, or a variation of the timer code      &lt;br /&gt;example (throw in an INKEY$ function) in this chapter for SLEEP N, and   &lt;br /&gt;i usually only use SLEEP when i'm busy enough doing other things to      &lt;br /&gt;avoid typing parenthesis: (example: SLEEP is very useful during          &lt;br /&gt;debugging.)                                                              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;timing                                                                   &lt;br /&gt;6 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;TIME$                                                                    &lt;br /&gt;has the double use of checking and setting the time.                     &lt;br /&gt;                                                                         &lt;br /&gt;to check the time, let q$=TIME$ which will set q$ to an 8-byte string    &lt;br /&gt;comprised of "hh:mm:ss" with hh being a pair of hour digits, mm being    &lt;br /&gt;minutes, and ss being seconds.                                           &lt;br /&gt;                                                                         &lt;br /&gt;to set the time, create a string in the same 8-byte "hh:mm:ss" format    &lt;br /&gt;and let TIME$=q$                                                         &lt;br /&gt;                                                                         &lt;br /&gt;easy!                                                                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;timing                                                                   &lt;br /&gt;7 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;DATE$ works like TIME$ and checks and sets the date with the format      &lt;br /&gt;month-day-year as "mm-dd-yyyy"                                           &lt;br /&gt;                                                                         &lt;br /&gt;note: if your computer is outside the united states, it's possible that  &lt;br /&gt;your OS and thus puppybasic will use a different date display.               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 15 =-                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                      (chapter 15) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-8896455975327323360?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/8896455975327323360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=8896455975327323360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8896455975327323360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8896455975327323360'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-15.html' title='puppybasic intro ch. 15 - timing'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-3520877382051153004</id><published>2007-02-02T15:48:00.000-08:00</published><updated>2007-02-03T07:03:33.474-08:00</updated><title type='text'>puppybasic intro ch. 14 - errors</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;1 of 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 14: errors                                     &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;2 of 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;you could do well to always trap and handle errors, i almost never       &lt;br /&gt;bother. if you write your program well, you might manage to avoid it.    &lt;br /&gt;this applies less to large programs. of course, sometimes error trapping &lt;br /&gt;is quite useful.                                                         &lt;br /&gt;                                                                         &lt;br /&gt;whether you use error handling or not, your program, upon encountering   &lt;br /&gt;an error, can tell the user the name of the error. if you do not trap    &lt;br /&gt;your errors, the program will end as well. if you do use error handling, &lt;br /&gt;you have the option of telling the user a more friendly interpretation   &lt;br /&gt;of the problem:                                                          &lt;br /&gt;                "I'm sorry, no file by that name exists in this folder." &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;3 of 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;or even fixing it so the program can continue:                           &lt;br /&gt;                                                                         &lt;br /&gt;"That file does not exist. Create? (Y/N)"                                &lt;br /&gt;                                                                         &lt;br /&gt;you can even trap errors to detect which screen modes don't work. as     &lt;br /&gt;mentioned in the graphics section, there are several screen modes in     &lt;br /&gt;puppybasic, and they start with SCREEN 0, or text-only mode and range   &lt;br /&gt;from 0 to 13. so, you can tell your program to go to all the possible  &lt;br /&gt;screen modes: (none of this is true, this tutorial is being edited.)                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;4 of 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;okscreen$ = SPACE$(14)                                                   &lt;br /&gt;ON ERROR GOTO oops                                                       &lt;br /&gt;FOR q = 0 TO 13                                                          &lt;br /&gt;SCREEN q                                                                 &lt;br /&gt;NEXT q: nomorec = 1                                                      &lt;br /&gt;                                                                         &lt;br /&gt;and then when it tries to SCREEN [not an available mode] it will cause   &lt;br /&gt;an error 5, and GOTO the "oops" routine:                                 &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;5 of 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;oops:                                                                    &lt;br /&gt;IF nomorec = 0 THEN                                                      &lt;br /&gt;IF ERR = 5 THEN MID$(okscreen$, q + 1) = "x"                             &lt;br /&gt;END IF                                                                   &lt;br /&gt;RESUME NEXT                                                              &lt;br /&gt;                                                                         &lt;br /&gt;which adds an "x" under the part of the variable okscreen$ for that      &lt;br /&gt;mode.                                                                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;6 of 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;the command RESUME NEXT tells the program "don't worry about that last   &lt;br /&gt;error..." and the program then runs the next line, which is the "NEXT q" &lt;br /&gt;of the FOR... NEXT loop.                                                 &lt;br /&gt;                                                                         &lt;br /&gt;when you're done trying all the modes, you can go back to SCREEN 0,      &lt;br /&gt;which is the default, and should always work:                            &lt;br /&gt;                                                                         &lt;br /&gt;SCREEN 0: WIDTH 80 'WIDTH 80 should always work, otherwise, remove it.   &lt;br /&gt;                                                                         &lt;br /&gt;then print a guide for the numbers 0 to 13:                              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;7 of 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;PRINT "          1111"                                                   &lt;br /&gt;PRINT "01234567890123"                                                   &lt;br /&gt;                                                                         &lt;br /&gt;and under that:                                                          &lt;br /&gt;                                                                         &lt;br /&gt;PRINT: PRINT okscreen$                                                   &lt;br /&gt;END 'don't forget to put an END statement between                        &lt;br /&gt;'your program and routines.                                              &lt;br /&gt;                                                                         &lt;br /&gt;now your program will put a little "x" under the modes that don't work   &lt;br /&gt;on your computer!                                                        &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;8 of 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;if we went over this section too fast: here is a review:                 &lt;br /&gt;                                                                         &lt;br /&gt;ON ERROR... GOTO linelabel                                               &lt;br /&gt;                                                                         &lt;br /&gt;tells the program what routine to goto when an error occurs. there is no &lt;br /&gt;"ON ERROR... GOSUB."                                                     &lt;br /&gt;                                                                         &lt;br /&gt;IF ERR=n THEN                                                            &lt;br /&gt;                                                                         &lt;br /&gt;will do something in response to the specific error... (you can also use &lt;br /&gt;"SELECT CASE ERR" for handling this part.)                               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;9 of 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;RESUME NEXT                                                              &lt;br /&gt;                                                                         &lt;br /&gt;goes back to the part of the program where the error occured, but it     &lt;br /&gt;goes to the first line AFTER the problem.                                &lt;br /&gt;                                                                         &lt;br /&gt;note: error code 5 is "illegal function call" - the error you get when &lt;br /&gt;you try to change to an unavailable mode, although there are other &lt;br /&gt;possible causes.  &lt;br /&gt;                                                                         &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;errors                                                                   &lt;br /&gt;10 of 10                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;there are at least a couple other commands for error handling, but       &lt;br /&gt;unless you want them enough to look them up, you probably won't ever     &lt;br /&gt;need them.                                                               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 14 =-                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                      (chapter 14) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-3520877382051153004?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/3520877382051153004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=3520877382051153004' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/3520877382051153004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/3520877382051153004'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-14.html' title='puppybasic intro ch. 14 - errors'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-2819949244430484751</id><published>2007-02-02T15:44:00.000-08:00</published><updated>2007-02-03T06:52:11.871-08:00</updated><title type='text'>puppybasic intro ch. 13 - working with text files</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;working with text files                                          &lt;br /&gt;1 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 13: working with text files                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with text files                                          &lt;br /&gt;2 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;working with text files is a bit different than working with binary      &lt;br /&gt;files... for one, the way you open the file depends on whether you will  &lt;br /&gt;be reading or writing. for this reason and a few others i prefer to      &lt;br /&gt;handle text files as if they were binaries and open them for binary      &lt;br /&gt;file access. you may find this is easier when you're starting out, you   &lt;br /&gt;may not. often i am too lazy and instead open text files as text files.  &lt;br /&gt;to print the following lines to a file:                                  &lt;br /&gt;this is a line. skip the next one:                                       &lt;br /&gt;                                                                         &lt;br /&gt;okay, this is another line...                                            &lt;br /&gt;this is, too.                                                            &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with text files                                          &lt;br /&gt;3 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;always OPEN the file:                                                    &lt;br /&gt;                                                                         &lt;br /&gt;OPEN "filename.txt" FOR OUTPUT AS #1                                     &lt;br /&gt;                                                                         &lt;br /&gt;if you do it this way it will start from scratch... that is,             &lt;br /&gt;"filename.txt" will be BLANKED if it wasn't before. for this reason you  &lt;br /&gt;will use APPEND for now. APPEND, instead of erasing the file, adds to    &lt;br /&gt;the end of it. if you are writing to a log, this is exactly what you     &lt;br /&gt;want. if you are only storing the data for a saved game file, this may   &lt;br /&gt;be problematic. in that case you may prefer OPEN... FOR OUTPUT.          &lt;br /&gt;regardless:                                                              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with text files                                          &lt;br /&gt;4 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;OPEN "filename.txt" FOR APPEND AS #1                                     &lt;br /&gt;                                                                         &lt;br /&gt;now we'll use the PRINT statement to write our lines to the file. the    &lt;br /&gt;file currently open is #1, so we'll use PRINT #1, q$                     &lt;br /&gt;                                                                         &lt;br /&gt;PRINT #1, "this is a line. skip the next one:"                           &lt;br /&gt;PRINT #1, ""                                                             &lt;br /&gt;PRINT #1, "okay, this is another line..."                                &lt;br /&gt;q$ = "this is, too."                                                     &lt;br /&gt;PRINT #1, q$                                                             &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with text files                                          &lt;br /&gt;5 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;the last line was printed differently to demonstrate again that a string &lt;br /&gt;is, after all, a string, and that you can PRINT #1, q$ as well as PRINT  &lt;br /&gt;an expression in quotes. both of these are examples of valid strings.    &lt;br /&gt;                                                                         &lt;br /&gt;always CLOSE the file when you're done working with it:                  &lt;br /&gt;CLOSE #1                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;if you are only working with one file, or if you don't have any other    &lt;br /&gt;files that you need to leave open, using CLOSE with no file numbers:     &lt;br /&gt;CLOSE                                                                    &lt;br /&gt;will close all the files your program has opened.                        &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with text files                                          &lt;br /&gt;6 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;now to read the file, we open it again, this time for input:             &lt;br /&gt;OPEN "filename.txt" FOR INPUT AS #1                                      &lt;br /&gt;                                                                         &lt;br /&gt;the text file is read one line at a time. one of the most reliable ways  &lt;br /&gt;to do this is to use line input from within a loop:                      &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with text files                                          &lt;br /&gt;7 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;DO: LINE INPUT #1, q$                                                    &lt;br /&gt;                                                                         &lt;br /&gt;PRINT q$ 'print the line to the screen                                   &lt;br /&gt;                                                                         &lt;br /&gt;the program has to know when to stop looping. EOF(1) is a condition that &lt;br /&gt;will be true when the end of the file is reached. it can end the LOOP    &lt;br /&gt;this way:                                                                &lt;br /&gt;          LOOP UNTIL EOF(1)                                              &lt;br /&gt;                                                                         &lt;br /&gt;you may find This LOOP superior for reading text files:                  &lt;br /&gt;DO WHILE EOF(1) = 0: LINE INPUT #1, q$: LOOP 'it handles 0-length files. &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with text files                                          &lt;br /&gt;8 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;if you only wanted to read the first line of course, the loop isn't      &lt;br /&gt;needed, only line input #1, q$                                           &lt;br /&gt;                                                                         &lt;br /&gt;close the file when you're done with it. no files are open that need to  &lt;br /&gt;stay open, so it's alright to just say:                                  &lt;br /&gt;                                                                         &lt;br /&gt;CLOSE                                                                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 13 =-                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                      (chapter 13) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-2819949244430484751?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/2819949244430484751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=2819949244430484751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/2819949244430484751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/2819949244430484751'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-13.html' title='puppybasic intro ch. 13 - working with text files'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-7284656163820740387</id><published>2007-02-02T15:41:00.000-08:00</published><updated>2007-02-02T19:34:40.411-08:00</updated><title type='text'>puppybasic intro ch. 12 - looping within the program</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;looping within the program                                        &lt;br /&gt;1 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 12: looping within the program                 &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;looping within the program&lt;br /&gt;2 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;as promised, here are two ways to remove GOTO from the earlier example:  &lt;br /&gt;                                                                         &lt;br /&gt;x=0                                                                      &lt;br /&gt;alabel:                                                                  &lt;br /&gt;x=x+1                                                                    &lt;br /&gt;IF x &gt; 5 THEN ? x        ' &gt; means "more than"                           &lt;br /&gt;IF &lt; 10 THEN GOTO alabel ' &lt; means "less than"                           &lt;br /&gt;                                                                         &lt;br /&gt;one way is DO... LOOP. it sort of works like this:                       &lt;br /&gt;alabel:                                                                  &lt;br /&gt;goto alabel unless condition is met...                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;looping within the program&lt;br /&gt;3 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;but it's better:                                                         &lt;br /&gt;                                                                         &lt;br /&gt;DO: 'no line label needed!                                               &lt;br /&gt;LOOP UNTIL cndtn=1                                                       &lt;br /&gt;                                                                         &lt;br /&gt;and the example:                                                         &lt;br /&gt;x=0                                                                      &lt;br /&gt;DO                                                                       &lt;br /&gt;x=x+1                                                                    &lt;br /&gt;IF x &gt; 5 THEN ? x                                                        &lt;br /&gt;LOOP UNTIL x &gt;= 10 ' &gt;= means "more than or equal to"                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;looping within the program&lt;br /&gt;4 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;if you had a very long version of this:                                  &lt;br /&gt;                                                                         &lt;br /&gt;x = 0                                                                    &lt;br /&gt;DO:                                                                      &lt;br /&gt;x = x + 1: IF INKEY$ = CHR$(27) THEN EXIT DO                             &lt;br /&gt;'stop loop if ESC pressed ^^^^                                           &lt;br /&gt;IF x &gt; 5 THEN PRINT x                                                    &lt;br /&gt;LOOP UNTIL x &gt;= 2 ^ 17 ' &gt;= means "more than or equal to"                &lt;br /&gt;                                                                         &lt;br /&gt;you could stop in the middle with INKEY$!                                &lt;br /&gt;(2 ^ 17 of course, is 2 raised to the 17th power)                        &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;looping within the program&lt;br /&gt;5 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;as mentioned before, INKEY$ will not wait for a keypress. if you've been &lt;br /&gt;pressing a key (in this loop, INKEY$ is checked many times each second)  &lt;br /&gt;then INKEY$ will detect it (there are some exceptions, like the CTRL     &lt;br /&gt;key...) but the program just keeps running whether a key is pressed or   &lt;br /&gt;not. it is also possible to pickup the most recent keypress using        &lt;br /&gt;INKEY$, because there is a buffer that tracks recently pressed keys. it  &lt;br /&gt;can get full, especially if you hold a key down, and you can use INKEY$  &lt;br /&gt;to clear it and prevent the computer from beeping at you.                &lt;br /&gt;                                                                         &lt;br /&gt;EXIT DO, as used here, stops the DO... LOOP and moves on to whatever     &lt;br /&gt;part of the program is after that. another way to do this is with OR:    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;looping within the program&lt;br /&gt;6 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;x = 0                                                                    &lt;br /&gt;DO:                                                                      &lt;br /&gt;x = x + 1                                                                &lt;br /&gt;IF x &gt; 5 THEN PRINT x                                                    &lt;br /&gt;LOOP UNTIL x &gt;= 2 ^ 17 OR INKEY$ = CHR$(32)                              &lt;br /&gt;'the spacebar sends an ascii 32.                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;FOR... NEXT                                                              &lt;br /&gt;is the way to loop with a number range.                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;looping within the program&lt;br /&gt;7 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;'this is the shorter loop from before, done with FOR... NEXT             &lt;br /&gt;                                                                         &lt;br /&gt;FOR x=1 TO 10                                                            &lt;br /&gt;IF x&gt;5 THEN ? x                                                          &lt;br /&gt;NEXT x                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;or even:                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;FOR x=5 TO 10                                                            &lt;br /&gt;? x                                                                      &lt;br /&gt;NEXT x                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;looping within the program&lt;br /&gt;8 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;to go in increments of less than 1, try STEP:                            &lt;br /&gt;FOR x=5 TO 10 STEP .5                                                    &lt;br /&gt;? x ' will print 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10              &lt;br /&gt;NEXT x                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;it adds .5 instead of 1. and you can go backwards, and over 1 at a time: &lt;br /&gt;                                                                         &lt;br /&gt;FOR x=10 TO 1 STEP -2                                                    &lt;br /&gt;? x ' will print 10, 8, 6, 4, 2... but not 1, because it will get to 2,  &lt;br /&gt;'and STEP -2 again, which is 0...or less than the range 10 to 1, get it? &lt;br /&gt;NEXT x                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;looping within the program&lt;br /&gt;9 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;to recreate the functionality of INPUT$(1) using INKEY$, use this line:  &lt;br /&gt;                                                                         &lt;br /&gt;DO: q$=INKEY$: LOOP UNTIL q$ &lt;&gt; "" ' &lt;&gt; means "not equal to"             &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;by the way, you might want to know the Other kind of DO... LOOP:         &lt;br /&gt;                                                                         &lt;br /&gt;DO WHILE condition = true  'makes sense?                                 &lt;br /&gt;LOOP                                                                     &lt;br /&gt;                                                                         &lt;br /&gt;                        -= end of chapter 12 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                      (chapter 12) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-7284656163820740387?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/7284656163820740387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=7284656163820740387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7284656163820740387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7284656163820740387'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-12.html' title='puppybasic intro ch. 12 - looping within the program'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-6085713464437579052</id><published>2007-02-02T15:39:00.000-08:00</published><updated>2007-02-02T19:32:56.676-08:00</updated><title type='text'>puppybasic intro ch. 11 - decision making</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;decision making                                                          &lt;br /&gt;1 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 11: decision making                            &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;decision making                                                          &lt;br /&gt;2 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;hey, now we make your programs smarter. right now your code does this:   &lt;br /&gt;                                                                         &lt;br /&gt;[do this.]                                                               &lt;br /&gt;                                                                         &lt;br /&gt;but we can make it so smart, it'll know whether to or not!               &lt;br /&gt;                                                                         &lt;br /&gt;[do this... but not unless i want you to.]                               &lt;br /&gt;                                                                         &lt;br /&gt;you just have to be really specific about what you want :D               &lt;br /&gt;                                                                         &lt;br /&gt;here's an example of IF...THEN, using the very naughty GOTO statement :O &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;decision making                                                          &lt;br /&gt;3 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;x=0                                                                      &lt;br /&gt;alabel:                                                                  &lt;br /&gt;x=x+1                                             ______________________ &lt;br /&gt;IF x &gt; 5 THEN ? x          ' &gt; means "more than"  __6___________________ &lt;br /&gt;IF x &lt; 10 THEN GOTO alabel ' &lt; means "less than"  __7___________________ &lt;br /&gt;                                                  __8___________________ &lt;br /&gt;which will PRINT this, on the screen     -&gt;       __9___________________ &lt;br /&gt;                                                  __10__________________ &lt;br /&gt;unless x is more than 5, it won't PRINT, and      ______________________ &lt;br /&gt;when x is 10, it won't go back to alabel.                                &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;decision making                                                          &lt;br /&gt;4 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;i'm still using GOTO in these examples, because GOTO is easy to teach.   &lt;br /&gt;sometimes, when it's easier to teach, it's easier to learn... but        &lt;br /&gt;regardless, you will soon learn a couple statements that help to         &lt;br /&gt;eliminate the use of GOTO, and are perfect for the example i just showed &lt;br /&gt;you. in fact, for what i just showed you, there are TWO perfectly        &lt;br /&gt;acceptable command pairs that can be used just as easily.                &lt;br /&gt;                                                                         &lt;br /&gt;for now, here's another example:                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;decision making                                                          &lt;br /&gt;5 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;PRINT "what's your name? - "                    ' *i'm not a chauvinist! &lt;br /&gt;LINE INPUT q$: q$=LTRIM$(RTRIM$(q$)) 'trim spaces                        &lt;br /&gt;'standard reply                                                          &lt;br /&gt;jim$ = "I am James T. Kirk... (Captain... of) "                          &lt;br /&gt;jim$ = jim$ + "the Starship... Enterprise..."                            &lt;br /&gt;                                                                         &lt;br /&gt;?:? "are you a female alien? (y/n)"                                      &lt;br /&gt;IF LCASE$(q$)=jim$ AND LCASE$(INPUT$(1))="y" THEN GOTO swoonfornoreason  &lt;br /&gt;                                                                         &lt;br /&gt;you see? it doesn't take much to make a program that thinks just like a  &lt;br /&gt;female alien, especially one from the 1960's! (I Said "ALIEN!")*         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;decision making                                                          &lt;br /&gt;6 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;that example uses AND, let's try one that uses OR, and throw in ELSE...  &lt;br /&gt;PRINT "what's your name? - "                                             &lt;br /&gt;LINE INPUT q$: q$=LTRIM$(RTRIM$(q$)) 'trim spaces                        &lt;br /&gt;o$=LCASE$(q$)                                                            &lt;br /&gt;                                                                         &lt;br /&gt;IF INSTR(o$,"bones")&gt;0 OR INSTR(o$,"mccoy")&gt;0 THEN                       &lt;br /&gt;? "i need mr. sulu in sickbay, he thinks we";                            &lt;br /&gt;? " really need a pilot to fly this thing!"                              &lt;br /&gt;ELSE                                                                     &lt;br /&gt;? "damnit, " + q$ +", you're not a doctor!"                              &lt;br /&gt;END IF                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;decision making                                                          &lt;br /&gt;7 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;that's an IF... THEN block. if you really want, it works as one long     &lt;br /&gt;line that won't fit the screen:                                          &lt;br /&gt;                                                                         &lt;br /&gt;IF INSTR(o$,"bones")&gt;0 OR INSTR(o$,"mccoy")&gt;0 THEN ? "i need mr. sulu    &lt;br /&gt;in sickbay, he thinks we";: ? " actually need a pilot to fly this        &lt;br /&gt;thing!" ELSE ? "damnit, " + q$ +", you're not a doctor!"                 &lt;br /&gt;                                                                         &lt;br /&gt;but for that to work you have to actually put it all on the same line.   &lt;br /&gt;who would want to? hence, an IF... THEN block is used.                   &lt;br /&gt;                                                                         &lt;br /&gt;here's a way to check many conditions, using SELECT... CASE:             &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;decision making                                                          &lt;br /&gt;8 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;? "input a number "; : LINE INPUT q$                                     &lt;br /&gt;SELECT CASE VAL(q$)                                                      &lt;br /&gt;CASE 1 TO 5: ? "your number is one at least, and five at most."          &lt;br /&gt;CASE 6 TO 10                                                             &lt;br /&gt;? "your number is six at least, and ten at most."                        &lt;br /&gt;CASE IS = 15                                                             &lt;br /&gt;? "fifteen? what's that got to do with anything?"                        &lt;br /&gt;CASE IS &gt; 20                                                             &lt;br /&gt;? "more than 20? i quit!" ' no particular reason...                      &lt;br /&gt;CASE ELSE: ? "i don't even understand this answer."                      &lt;br /&gt;END SELECT                                                               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;decision making                                                          &lt;br /&gt;9 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;"CASE ELSE" of course, runs the code following that line if none of the  &lt;br /&gt;other "CASE" conditions are met. CASE is also really handy for an if     &lt;br /&gt;that uses numerous values:                                               &lt;br /&gt;                                                                         &lt;br /&gt;SELECT CASE LTRIM$(RTRIM$(LCASE$(q$)))                                   &lt;br /&gt;CASE "susie", "janie", "jamie", "josie", "connie", "carrie", "mary"      &lt;br /&gt;? "didn't we used to date?"                                              &lt;br /&gt;CASE ELSE                                                                &lt;br /&gt;? "so what are you doing tuesday?" '* AM NOT! SEE PAGE 5!                &lt;br /&gt;END SELECT                                                               &lt;br /&gt;                        -= end of chapter 11 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                      (chapter 11) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-6085713464437579052?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/6085713464437579052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=6085713464437579052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/6085713464437579052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/6085713464437579052'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-11.html' title='puppybasic intro ch. 11 - decision making'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-409321345673312713</id><published>2007-02-02T15:36:00.000-08:00</published><updated>2007-02-02T19:31:19.245-08:00</updated><title type='text'>puppybasic intro ch. 10 - branching within the program</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;branching within the program                               &lt;br /&gt;1 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 10: branching within the program               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program                               &lt;br /&gt;2 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;GOTO is easy enough to use, first you'll want a line number:             &lt;br /&gt;                                                                         &lt;br /&gt;90                                                                       &lt;br /&gt;                                                                         &lt;br /&gt;or instead of that, a linelabel:                                         &lt;br /&gt;                                                                         &lt;br /&gt;hey:                                                                     &lt;br /&gt;                                                                         &lt;br /&gt;using similar rules for naming labels that you do for naming variables.  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;3 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;you can then tell the program to stop running exactly where it is        &lt;br /&gt;(usually the program runs the first line, then the second line, then the &lt;br /&gt;third line... not anymore!) and start running at that line number:       &lt;br /&gt;                                                                         &lt;br /&gt;GOTO 90                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;or that linelabel:                                                       &lt;br /&gt;                                                                         &lt;br /&gt;GOTO hey                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;4 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;and the easiest way to use it is to make the program do the same thing   &lt;br /&gt;over and over:                                                           &lt;br /&gt;                                                                         &lt;br /&gt;10 PRINT "not again! ";                                                  &lt;br /&gt;GOTO 10                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;so why are they all multiples of 10? well, no reason these days. about   &lt;br /&gt;100 years ago (20 to 30, actually) you didn't use (by default) a text   &lt;br /&gt;editor like the one you use with puppybasic. you had a program that&lt;br /&gt;simply waited for you to type lines, and then if it started with a line &lt;br /&gt;number, it added that line to the whole program...                               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;5 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;you only saw the lines you were typing, and if you typed LIST and hit    &lt;br /&gt;enter, it would show you the program listing. the trick was listing      &lt;br /&gt;programs that were more than about 20 lines long :)                      &lt;br /&gt;                                                                         &lt;br /&gt;you could make it easier to insert lines by "naming" them multiples of   &lt;br /&gt;10. that way if you wanted a line between 10 and 20 for instance, you    &lt;br /&gt;could just name it 15. you could copy a line to another number by        &lt;br /&gt;displaying it and writing the new number over the old, but if you had a  &lt;br /&gt;50 line program and all the numbers were increments of 1, not 10, the    &lt;br /&gt;need to insert a new line left you in a bad place! :)                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;6 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;now you have a bit of basic history. you youngsters don't know how       &lt;br /&gt;spoiled you are!                                                         &lt;br /&gt;                                                                         &lt;br /&gt;something you'll really want to know if you're going to use goto: when   &lt;br /&gt;you get stuck in a loop, you can stop the program from running by        &lt;br /&gt;holding down CTRL and hitting the C key... failing that-try CTRL + BREAK &lt;br /&gt;(not now! it might stop this program, too!) this is better than the      &lt;br /&gt;CTRL + ALT + DEL, that will end puppybasic as well, or restart your &lt;br /&gt;computer.                           &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;7 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;GOSUB should be used to replace GOTO when possible. by modern standards, &lt;br /&gt;the regular use of GOTO is not considered good coding. GOSUB is slightly &lt;br /&gt;more tricky, but much more useful.                                       &lt;br /&gt;                                                                         &lt;br /&gt;the first thing you want to do is make a stopping point between your     &lt;br /&gt;main program and your subroutines. for the purpose of introduction, a    &lt;br /&gt;subroutine is a part of your program that is branched to using GOSUB     &lt;br /&gt;and left by using RETURN. subroutines are like miniature programs        &lt;br /&gt;themselves.                                                              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;8 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;for now, put:                                                            &lt;br /&gt;                                                                         &lt;br /&gt;END                                                                      &lt;br /&gt;                                                                         &lt;br /&gt;at the end of your program, to make the program stop. AFTER the END      &lt;br /&gt;statement, put all your subroutines.                                     &lt;br /&gt;                                                                         &lt;br /&gt;for instance, here is a subroutine to clear the screen, greet the user,  &lt;br /&gt;and change the color back to white:                                      &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;9 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;starting:                                                                &lt;br /&gt;CLS: COLOR 10                                                            &lt;br /&gt;? "**  program that does nothing but start  **"                          &lt;br /&gt;? "    2005 by mennonite"                                                &lt;br /&gt;COLOR 7                                                                  &lt;br /&gt;?                                                                        &lt;br /&gt;RETURN                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;from inside your main program, that is, before the end statement, use:   &lt;br /&gt;                                                                         &lt;br /&gt;GOSUB starting                                                           &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;10 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;and it will run the code in the subroutine, then come right back to      &lt;br /&gt;where it left off-just after the GOSUB command! you get all that? again: &lt;br /&gt;                                                                         &lt;br /&gt;GOSUB starting: END                                                      &lt;br /&gt;starting:                                                                &lt;br /&gt;CLS: COLOR 10                                                            &lt;br /&gt;? "**  program that does nothing but start  **"                          &lt;br /&gt;? "    2005 by mennonite"                                                &lt;br /&gt;COLOR 7                                                                  &lt;br /&gt;?                                                                        &lt;br /&gt;RETURN                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;11 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;this is one of the most important features of programming in languages   &lt;br /&gt;like puppybasic. make sure you become comfortable, when you write a &lt;br /&gt;longer program it's almost impossible to do without these subroutines. &lt;br /&gt;                                                                         &lt;br /&gt;so why did we make the program stop before the subroutines were run? we  &lt;br /&gt;didn't, actually, the subroutine ran... only if your program gets to the &lt;br /&gt;end and then starts running the subroutines that follow, it will         &lt;br /&gt;encounter the RETURN statement without having any GOSUB calling the      &lt;br /&gt;routine... the program will think: (and this is how stupid computers     &lt;br /&gt;really are...) "RETURN? return to where?!" and have a fit and refuse to  &lt;br /&gt;do more. it's not usually dangerous, but it makes you look incompetent.  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;12 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;REM this won't do anything                                               &lt;br /&gt;                                                                         &lt;br /&gt;the old way to add comments to your program code! and it still works...  &lt;br /&gt;but it's even easier to use an apostrophe.                               &lt;br /&gt;                                                                         &lt;br /&gt;' this won't do anything either                                          &lt;br /&gt;                                                                         &lt;br /&gt;REM but more importantly, you can put this '                             &lt;br /&gt;                                                                         &lt;br /&gt;atthe = endof * aline - 1 'instead of                                    &lt;br /&gt;' the beginning of a new one                                             &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;13 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;' comments are good to use, because when someone else looks at your      &lt;br /&gt;' code, they have a Much easier time figuring out what it all does.      &lt;br /&gt;                                                                         &lt;br /&gt;(and sometimes, when you're looking at a program you wrote a long time   &lt;br /&gt;ago, you'll wish there were comments there.)                             &lt;br /&gt;                                                                         &lt;br /&gt;i usually don't do much with comments until version 2, (0.2 or 0.4 or 5  &lt;br /&gt;if there are betas ;) because if my program is good enough to show       &lt;br /&gt;people, it's good enough to make a version 2 of, and like too many       &lt;br /&gt;people, i'm sort of lazy about comments. please consider the merits of   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;branching within the program&lt;br /&gt;14 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;doing what i say, not what i do :) all the same, know you can get flamed &lt;br /&gt;(that is, people may be uncharitable ;) if rarely, online if you write   &lt;br /&gt;code that's hard for other people to understand without enough comments. &lt;br /&gt;don't go nuts though, too many comments can be annoying, also. (not as   &lt;br /&gt;many will complain about this.)                                          &lt;br /&gt;                                                                         &lt;br /&gt;of course, a really good rule would be: ALWAYS put a comment at the top  &lt;br /&gt;of your program that at least says what your program does. you'll go far &lt;br /&gt;that way.                                                                &lt;br /&gt;                                                                         &lt;br /&gt;                        -= end of chapter 10 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                      (chapter 10) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-409321345673312713?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/409321345673312713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=409321345673312713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/409321345673312713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/409321345673312713'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-10.html' title='puppybasic intro ch. 10 - branching within the program'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-4181693766375953113</id><published>2007-02-02T15:35:00.000-08:00</published><updated>2007-02-02T19:30:34.392-08:00</updated><title type='text'>puppybasic intro ch. 09 - working with binary files</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;working with binary files                                        &lt;br /&gt;1 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 9: working with binary files                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with binary files                                        &lt;br /&gt;2 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;it might be fun at this point to learn how to save and load some data in &lt;br /&gt;a file, but this will be much more useful when you've learned about      &lt;br /&gt;decision making and loops. in the meantime, here is how to work with     &lt;br /&gt;binary files:                                                            &lt;br /&gt;                                                                         &lt;br /&gt;first of all, be sure to use this statement at the beginning of your     &lt;br /&gt;program:                                                                 &lt;br /&gt;DIM bt AS STRING * 1                                                     &lt;br /&gt;                                                                         &lt;br /&gt;so that you have a one byte string to work with. you can make longer     &lt;br /&gt;strings, but this one will work for any purpose.                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with binary files                                        &lt;br /&gt;3 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;always open the file :)                                                  &lt;br /&gt;                                                                         &lt;br /&gt;OPEN "filename.txt" FOR BINARY AS #1                                     &lt;br /&gt;                                                                         &lt;br /&gt;if you are only going to read the file, you dont strictly need the bt    &lt;br /&gt;variable, and therefore don't need to DIM at the start of your program.  &lt;br /&gt;just INPUT a byte:                                                       &lt;br /&gt;                                                                         &lt;br /&gt;b$=INPUT$(1, #1)                                                         &lt;br /&gt;                                                                         &lt;br /&gt;and that's all there is to that. yes, it IS similar to keyboard input.   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with binary files                                        &lt;br /&gt;4 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;do it again to read the next byte. usually, you'll probably want to use  &lt;br /&gt;this method instead:                                                     &lt;br /&gt;                                                                         &lt;br /&gt;GET #1, q, bt                                                            &lt;br /&gt;with q being the byte of the file you want to read... if q is 57, then   &lt;br /&gt;it will read the 57th byte of the file.                                  &lt;br /&gt;                                                                         &lt;br /&gt;to write, use:                                                           &lt;br /&gt;PUT #1, q, bt                                                            &lt;br /&gt;where b is a string that's only one byte (or letter) long. it's pretty   &lt;br /&gt;much the same idea. some useful functions for working with files are:    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with binary files                                        &lt;br /&gt;5 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;q = FREEFILE                                                             &lt;br /&gt;                                                                         &lt;br /&gt;sets q to the number of the next filenumber that's free... if you've     &lt;br /&gt;opened a file as #1, and a second file, as #2, then FREEFILE will equal  &lt;br /&gt;3.                                                                       &lt;br /&gt;                                                                         &lt;br /&gt;LOC(n)                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;is the byte you're set to read or write at. if you've used INPUT$(1, #1) &lt;br /&gt;                                                                         &lt;br /&gt;50 times already, LOC(1) will be 51.                                     &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with binary files                                        &lt;br /&gt;6 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;LOF(n)                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;is worth remembering, LOF(n) is equal to the length of file #n, if you   &lt;br /&gt;open a file as #1 and the LOF(1) is 0, that file is empty.               &lt;br /&gt;                                                                         &lt;br /&gt;always close the file when you're done working with it:                  &lt;br /&gt;                                                                         &lt;br /&gt;CLOSE #1                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;if you are only working with one file, or if you don't have any other    &lt;br /&gt;files that you need to leave open, using close with no file numbers:     &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;working with binary files                                        &lt;br /&gt;7 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;CLOSE                                                                    &lt;br /&gt;                                                                         &lt;br /&gt;will close all files.                                                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 9 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                       (chapter 9) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-4181693766375953113?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/4181693766375953113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=4181693766375953113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/4181693766375953113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/4181693766375953113'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-09.html' title='puppybasic intro ch. 09 - working with binary files'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-5739377945595468084</id><published>2007-02-02T15:30:00.000-08:00</published><updated>2007-02-02T18:06:34.278-08:00</updated><title type='text'>puppybasic intro ch. 08 - strings part ii</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;strings part ii:  searching and manipulation                              &lt;br /&gt;1 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 8: strings part ii                              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part ii:  searching and manipulation                              &lt;br /&gt;2 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;although you could find a better routine to do the same thing, INSTR is  &lt;br /&gt;a very fast and simple way to see if and when a string exists as part of &lt;br /&gt;a larger string: for instance:                                           &lt;br /&gt;                                                                         &lt;br /&gt;suppose q$ is storing the string:                                        &lt;br /&gt;"the quick brown fox jumped, and stuff."                                 &lt;br /&gt;                                                                         &lt;br /&gt;and you want to know if the string (let's pretend you don't know what q$ &lt;br /&gt;is; maybe it's from a file or the keyboard.) contains the word "fox" so  &lt;br /&gt;you code:                                                                &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part ii:  searching and manipulation                              &lt;br /&gt;3 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;n = INSTR(q$, "fox")                                                     &lt;br /&gt;                                                                         &lt;br /&gt;n will be equal to the number of letters, numbers, and punctuation that  &lt;br /&gt;you have to read before you've started reading "fox"... in this case,    &lt;br /&gt;the "f" in "fox" is the 17th byte in q$, so INSTR will set n to 17. if   &lt;br /&gt;the string "fox" is not found in the string that q$ is storing, n will   &lt;br /&gt;be set to 0.                                                             &lt;br /&gt;                 1                                                       &lt;br /&gt; 123456789012345 7 90123456789012345678                                  &lt;br /&gt;"the quick brown fox jumped, and stuff."                                 &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part ii:  searching and manipulation                              &lt;br /&gt;4 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;SPACE$                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;is really, really easy to use. SPACE$(n) is a string of ascii 32 (space) &lt;br /&gt;that is n bytes long. q$=q$+SPACE$(10) will add 10 spaces to the end of  &lt;br /&gt;q$.                                                                      &lt;br /&gt;                                                                         &lt;br /&gt;LEFT$ and RIGHT$                                                         &lt;br /&gt;                                                                         &lt;br /&gt;are not as powerful or complete as MID$ but are slightly easier to use.  &lt;br /&gt;skipping straight to examples, LEFT$("Seventy",5) is "Seven" and         &lt;br /&gt;RIGHT$("elephant",3) is "ant". MID$ is similar:                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part ii:  searching and manipulation                              &lt;br /&gt;5 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;the syntax for the MID$ function is:                                     &lt;br /&gt;                                                                         &lt;br /&gt;MID$(q$, whichbytetostartat, howmanybytes)                               &lt;br /&gt;                                                                         &lt;br /&gt;so n$=MID$("hello", 2, 4) would set n$ to "ello" and                     &lt;br /&gt;n$=MID$("yeah, or... something", 14, 2) would set n$ to "om".            &lt;br /&gt;                                                                         &lt;br /&gt;there is a MID$ statement as well, which works the same way, except      &lt;br /&gt;instead of reading a string it will rewrite it:                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part ii:  searching and manipulation                              &lt;br /&gt;6 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;y$="yeah, or... something"                                               &lt;br /&gt;n$=SPACE$(2)+"no"                                                        &lt;br /&gt;                                                                         &lt;br /&gt;MID$(y$, 13, 4)=n$                                                       &lt;br /&gt;                                                                         &lt;br /&gt;will store "yeah, or...   nothing" in y$. the 4-byte "some" has been     &lt;br /&gt;replaced with 2 spaces and "no", changing "something" to "  nothing".    &lt;br /&gt;whoosh!                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part ii:  searching and manipulation                              &lt;br /&gt;7 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;if you do not like the MID$ statement for rewriting, it is totally       &lt;br /&gt;possible to avoid it entirely using only the MID$ "reading" function     &lt;br /&gt;and concatonization of strings.                                          &lt;br /&gt;                                                                         &lt;br /&gt;there are times (especially with code like the first menu routine,       &lt;br /&gt;earlier) when your variable will have leading or trailing spaces that    &lt;br /&gt;you don't want. when you use STR$(n) to convert a numeric variable to a  &lt;br /&gt;string for instance, it will contain a leading space (if it is at least  &lt;br /&gt;zero) for a plus sign, even though the plus sign will never show. if the &lt;br /&gt;number drops below zero, a negative sign will show, but otherwise, you   &lt;br /&gt;may be stuck with a space you don't want, like this: " 55".              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part ii:  searching and manipulation                              &lt;br /&gt;8 of 8                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;LTRIM$(STR$(n))                                                          &lt;br /&gt;                                                                         &lt;br /&gt;will remove the leading spaces from a number, and LTRIM$(RTRIM$(q$))     &lt;br /&gt;will remove the spaces from both ends of any string. this is not only    &lt;br /&gt;useful when changing numbers to strings, but also when accepting         &lt;br /&gt;keyboard input or data from files.                                       &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 8 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                       (chapter 8) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-5739377945595468084?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/5739377945595468084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=5739377945595468084' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/5739377945595468084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/5739377945595468084'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-08.html' title='puppybasic intro ch. 08 - strings part ii'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-7645415169819499046</id><published>2007-02-02T15:28:00.000-08:00</published><updated>2007-02-02T18:05:58.875-08:00</updated><title type='text'>puppybasic intro ch. 07 - keyboard and data lines</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;1 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 7: keyboard and data lines                     &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;2 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;let's get DATA statements out of the way, since i find them irritating,  &lt;br /&gt;although you'll want to know how they work when you see them in someone  &lt;br /&gt;else's code.                                                             &lt;br /&gt;                                                                         &lt;br /&gt;DATA statements (though as i said, i don't like them) are easy enough to &lt;br /&gt;use.                                                                     &lt;br /&gt;                                                                         &lt;br /&gt;anywhere in the main module of the program (don't even worry about what  &lt;br /&gt;that is) put the statement DATA followed by the strings or numbers you   &lt;br /&gt;want read, separated by commas:                                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;3 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;DATA ugh., data, statements-, that takes, me back.                       &lt;br /&gt;                                                                         &lt;br /&gt;READ q$: ? q$;  ________________________________________________________ &lt;br /&gt;READ q$: ? q$;  _ugh.datastatements-that takesme back.__________________ &lt;br /&gt;READ q$: ? q$;  ________________________________________________________ &lt;br /&gt;READ q$: ? q$;  ________________________________________________________ &lt;br /&gt;READ q$: ? q$;                                                           &lt;br /&gt;there are better ways, but this works. if you use DATA statements, you   &lt;br /&gt;may find that you want to put something unique as the last string or     &lt;br /&gt;number so that your routine can "know" when it's done reading, but       &lt;br /&gt;you'll need loops and decision making (covered later) to pull it off.    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;4 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;if you READ a number of times greater than your number of data entries,  &lt;br /&gt;you get an error and your program stops. to avoid this, don't read a     &lt;br /&gt;greater number of times than your number of entries. (heh.) along with a &lt;br /&gt;unique last entry, you can reread from the beginning of your data        &lt;br /&gt;statements. (puppybasic looks at all of them together, from the &lt;br /&gt;beginning of your program to the end, as one long data statement) by &lt;br /&gt;putting an old fashioned line number (like 20) before your first data &lt;br /&gt;statement, which then allows you to use the command:                                      &lt;br /&gt;                                                                         &lt;br /&gt;RESTORE 20                                                               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;5 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;whenever you want to reread. you can also move to different places (in   &lt;br /&gt;your single virtually continuous data line) but putting line numbers     &lt;br /&gt;between DATA statements:                                                 &lt;br /&gt;                                                                         &lt;br /&gt;RESTORE 70: READ b$: PRINT b$ + ",";: READ b$: PRINT b$; "."             &lt;br /&gt;                                                                         &lt;br /&gt;50                      ________________________________________________ &lt;br /&gt;DATA 5,6,7,8,9          _ok,that's enough.______________________________ &lt;br /&gt;70                      ________________________________________________ &lt;br /&gt;DATA ok, that's enough  ________________________________________________ &lt;br /&gt;                        ________________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;6 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;i think the most versatile way to get keyboard input is with the INKEY$  &lt;br /&gt;function, but it doesn't wait for input: it just says "hey! keyboard,    &lt;br /&gt;what's happenin'?" and unless a key has been pressed already the         &lt;br /&gt;keyboard just says "..." and INKEY$ returns an empty, 0-length string... &lt;br /&gt;not even a space, just the nothing between two quotes, side by side: "". &lt;br /&gt;                                                                         &lt;br /&gt;there's nothing wrong with this, it's just that INKEY$ only works in a   &lt;br /&gt;loop, so i'll demonstrate INKEY$ after showing how loops work. in the    &lt;br /&gt;meantime, INPUT$(n) is similar, and not too shabby. i'll show you that   &lt;br /&gt;momentarily. in order to appreciate the simple beauty of INPUT$(n) you   &lt;br /&gt;have to see the alternatives:                                            &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;7 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;INPUT "", q$                                                             &lt;br /&gt;                                                                         &lt;br /&gt;you can put stuff in the quotes, and then it's like a PRINT statement,   &lt;br /&gt;but i prefer using PRINT to print and INPUT for input. one advantage of  &lt;br /&gt;separating the two is that you can put the instructions and the visible  &lt;br /&gt;end of the keyboard input on separate lines or different locations on    &lt;br /&gt;the screen. i'm really trying to set a good example here by showing      &lt;br /&gt;INPUT used with a comma - you could use a semicolon:  INPUT ""; q$       &lt;br /&gt;                                                                         &lt;br /&gt;but INPUT "please type your name - "; q$  ______________________________ &lt;br /&gt;will show up on the screen like this:     _please type your name - ?____ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;8 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;because as we all know the ONLY way to get information from the user is  &lt;br /&gt;in the form of a full sentence followed by a question mark :|            &lt;br /&gt;                                                                         &lt;br /&gt;ah well. this is why using a comma is better.                            &lt;br /&gt;                                                                         &lt;br /&gt;of course, i don't actually recommend using the INPUT statement, ever.   &lt;br /&gt;LINE INPUT is used the same way you just learned (see? that wasn't in    &lt;br /&gt;vain) but is more reliable. i'll explain:                                &lt;br /&gt;                                                                         &lt;br /&gt;say for instance, you used this code:                                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;9 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;INPUT "enter your name - ", n$     _____________________________________ &lt;br /&gt;and say for instance, he entered:  _enter your name - smith, john q.____ &lt;br /&gt;                                   _____________________________________ &lt;br /&gt;then he would see this message:    _REDO FROM START?____________________ &lt;br /&gt;                                   _____________________________________ &lt;br /&gt;great! what?                       _____________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;it's because he typed a comma. the INPUT statement is designed so that   &lt;br /&gt;you can get more than one piece of data from the same prompt, separated  &lt;br /&gt;by commas, like this:                                                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;10 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;INPUT "please enter three numbers, put commas between the first          &lt;br /&gt;and second, and also between the second and third, and don't forget      &lt;br /&gt;them, and don't put too many, or my input routine will yell at you.      &lt;br /&gt;thanks. ", a, b, c                                                       &lt;br /&gt;                                                                         &lt;br /&gt;assuming your plucky user gets it exactly right, the clever INPUT        &lt;br /&gt;statement will save an extra line of code.                               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;Bad Design!                                                              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;11 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;so i never use the INPUT statement. ever. instead i use this when i want &lt;br /&gt;a no fuss, two line method of getting keyboard input (there are better   &lt;br /&gt;ways using INKEY$, remember?)                                            &lt;br /&gt;                                                                         &lt;br /&gt;PRINT "please enter your name. as long as your name has less than 250    &lt;br /&gt;characters and doesn't contain carriage returns, we shouldn't have any   &lt;br /&gt;problems:": ?: line input n$                                             &lt;br /&gt;                                                                         &lt;br /&gt;all this is okay, for typing in a line of data and hitting enter. if you &lt;br /&gt;have a menu on the other hand:                                           &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;12 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;1. do something                                                          &lt;br /&gt;                                                                         &lt;br /&gt;2. do something else                                                     &lt;br /&gt;                                                                         &lt;br /&gt;3. do something entirely different                                       &lt;br /&gt;                                                                         &lt;br /&gt;4. exit                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;then the following prompt might seem reasonable:                         &lt;br /&gt;                                                                         &lt;br /&gt;? "please enter your selection - ";: LINE INPUT q$                       &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;13 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;but i think this is better:                                              &lt;br /&gt;                                                                         &lt;br /&gt;1. do something                                                          &lt;br /&gt;                                                                         &lt;br /&gt;2. do something else                                                     &lt;br /&gt;                                                                         &lt;br /&gt;3. do something entirely different                                       &lt;br /&gt;                                                                         &lt;br /&gt;? "select an option (1-3) or hit [esc] to exit :)": q$=INPUT$(1)         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;14 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;now q$ will be exactly one byte long and be a 1, or 2, or 3, or esc      &lt;br /&gt;(esc is ascii 27.) it might be something else, but you can check to see  &lt;br /&gt;if it's one of the acceptable options, and repeat until it's a key you   &lt;br /&gt;are looking for. yeah, i'll get to looping.                              &lt;br /&gt;                                                                         &lt;br /&gt;you can also change the "1" in INPUT$(1) to another number, 5 for        &lt;br /&gt;instance, if you want exactly 5 keys input to the program. this too, is  &lt;br /&gt;bad design because the person can't see what they're typing, and can't   &lt;br /&gt;backspace if they hit a wrong key.                                       &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;keyboard and data lines                                                  &lt;br /&gt;15 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;usually, i'll use INKEY$. in a loop, INKEY$ can act just like INPUT$(n)  &lt;br /&gt;if you want it to and can detect arrow and function keys as well.        &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 7 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                       (chapter 7) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-7645415169819499046?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/7645415169819499046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=7645415169819499046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7645415169819499046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7645415169819499046'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-07.html' title='puppybasic intro ch. 07 - keyboard and data lines'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-4950158615008320709</id><published>2007-02-02T15:26:00.000-08:00</published><updated>2007-02-02T18:05:22.504-08:00</updated><title type='text'>puppybasic intro ch. 06 - more with text</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;more with the text screen                                                &lt;br /&gt;1 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 6: more with text                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;more with text                                              &lt;br /&gt;2 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;with PRINT, COLOR, and CLS already covered, here are some more ways to   &lt;br /&gt;work with the text-only screen:                                          &lt;br /&gt;                                                                         &lt;br /&gt;LOCATE y                                                                 &lt;br /&gt;will tell puppybasic to start printing on row y of the screen.               &lt;br /&gt;                                                                         &lt;br /&gt;or                                                                       &lt;br /&gt;                                                                         &lt;br /&gt;LOCATE y, x                                                              &lt;br /&gt;well tell puppybasic to print at row y, column x. x is usually 1 to 80.      &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;more with text                                               &lt;br /&gt;3 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;though it flies in the face of cartesian graphs, descartes was a bit of  &lt;br /&gt;a jerk after all, and it makes enough sense to address text as row,      &lt;br /&gt;column. the LOCATE command lets you do this, but you may not be able to  &lt;br /&gt;do anything on the bottom row (this tends to be the 25th one) unless     &lt;br /&gt;your PRINT command uses a semicolon;                                     &lt;br /&gt;                                                                         &lt;br /&gt;LOCATE 25, 1                                                             &lt;br /&gt;PRINT "print with a semicolon on the end to print on the bottom row.";   &lt;br /&gt;                                                                         &lt;br /&gt;________________________________________________________________________ &lt;br /&gt;_print with a semicolon on the end to print on the bottom row.__________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;more with text                                                &lt;br /&gt;4 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;also, making the cursor fly back and forth can be sort of annoying, so:  &lt;br /&gt;                                                                         &lt;br /&gt;LOCATE y, x, 0 ...makes it go away and (when you want it to show where   &lt;br /&gt;someone is going to be typing, for instance)                             &lt;br /&gt;                                                                         &lt;br /&gt;LOCATE y, x, 1                                                           &lt;br /&gt;makes it come back. &lt;br /&gt;                                                                         &lt;br /&gt;&lt;br /&gt;                                                                         &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;more with text                                                 &lt;br /&gt;5 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;now that you are thinking in terms of coordinates,                       &lt;br /&gt;                                                                         &lt;br /&gt;CSRLIN                                                                   &lt;br /&gt;represents the row the cursor is on, and                                 &lt;br /&gt;                                                                         &lt;br /&gt;POS(0)                                                                   &lt;br /&gt;represents the column. if you print something to the screen, let         &lt;br /&gt;a = CSRLIN and b = POS(0), LOCATE to some point on the screen (say the   &lt;br /&gt;top lefthand corner,) PRINT something there and then LOCATE a, b, you    &lt;br /&gt;will then pick up where you left off. this sort of thing can be useful   &lt;br /&gt;for status bars.                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;more with text                                                 &lt;br /&gt;6 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;VIEW PRINT                                                               &lt;br /&gt;                                                                         &lt;br /&gt;is odd but i find it useful: where the text-only screen usually has 25   &lt;br /&gt;rows, you can force smaller ranges. VIEW PRINT 10 to 17 keeps the text   &lt;br /&gt;currently displayed on all 25 lines, but when you print within lines 10  &lt;br /&gt;to 17 it will only scroll within (and change) lines 10 through 17.       &lt;br /&gt;                                                                         &lt;br /&gt;q = SCREEN (y, x)                                                        &lt;br /&gt;will set the variable q to the ascii value of whatever character is at   &lt;br /&gt;position y, x, so that you can not only print to the screen, but read    &lt;br /&gt;from it as well.                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;more with text                                                &lt;br /&gt;7 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;WIDTH columns, rows                                                      &lt;br /&gt;                                                                         &lt;br /&gt;can be useful, but what you can enter as acceptable values for columns   &lt;br /&gt;and rows depends on what screen mode you're using. in text only mode,    &lt;br /&gt;                                                                         &lt;br /&gt;WIDTH , 50                                                               &lt;br /&gt;gives you twice as much top-down room to work with (try 43 too), but     &lt;br /&gt;                                                                         &lt;br /&gt;WIDTH 40 (horizontal) doesn't work reliably. this is covered later with  &lt;br /&gt;the SHELL command.                                                       &lt;br /&gt;                         -= end of chapter 6 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                       (chapter 6) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-4950158615008320709?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/4950158615008320709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=4950158615008320709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/4950158615008320709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/4950158615008320709'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-06.html' title='puppybasic intro ch. 06 - more with text'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-8490806458010195078</id><published>2007-02-02T15:21:00.000-08:00</published><updated>2007-02-02T18:04:02.228-08:00</updated><title type='text'>puppybasic intro ch. 05 - strings part i</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;strings part i:  the indispensable                                       &lt;br /&gt;1 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 5: strings part i                              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part i:  the indispensable                                       &lt;br /&gt;2 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;although you need to talk to the computer to write a program, and you    &lt;br /&gt;usually need math to talk to the computer, you usually need strings      &lt;br /&gt;(which may contain plain english) to talk to the person using the        &lt;br /&gt;computer. for this and other reasons, strings are generally as vital to  &lt;br /&gt;your program as numbers. here are some statements to work with strings:  &lt;br /&gt;                                                                         &lt;br /&gt;UCASE$                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;q$=UCASE$(q$) will convert q$ to an all uppercase copy of itself. the    &lt;br /&gt;lowercase version is:                                                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part i:  the indispensable                                       &lt;br /&gt;3 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;LCASE$                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;q$=LCASE$(q$) when you've printed "press q to quit" can be the           &lt;br /&gt;difference between a person being able to exit your program when they    &lt;br /&gt;want to and being able to a bit later (when someone points out that      &lt;br /&gt;their caps lock light is on.) it is possible to turn off someone's caps  &lt;br /&gt;lock for them using program code, but processing strings with LCASE$ is  &lt;br /&gt;easier and more considerate.                                             &lt;br /&gt;                                       _________________________________ &lt;br /&gt;q$="NAME@PUPPY.Com": PRINT LCASE$(q$)  _name@puppy.com__________________ &lt;br /&gt;                                       _________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part i:  the indispensable                                       &lt;br /&gt;4 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;CHR$ is indispensable: there are 256 different ASCII characters, (for    &lt;br /&gt;example, the lowercase letter "a" is ASCII 97, and a space, like from    &lt;br /&gt;the spacebar, is ASCII 32.) including letters, numbers, punctuation, and &lt;br /&gt;other fun symbols (ASCII 01 is a smiley face. &amp;#9786; for the most part, the   &lt;br /&gt;only way to produce some of them is with CHR$. for instance, if you want &lt;br /&gt;to produce a double quote on the screen, or within a string, you can use &lt;br /&gt;the following code: (put it all on the same line, of course...)          &lt;br /&gt;? "i have been learning about puppybasic from "+CHR$(34)+"an intro to &lt;br /&gt;puppybasic"+CHR$(34)+" and it's okay..."                  &lt;br /&gt;                                                                         &lt;br /&gt;...as ASCII 34 is the same double quote you would get from the keyboard. &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part i:  the indispensable                                       &lt;br /&gt;5 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;+------+---------------------------------------------------------------+ &lt;br /&gt;| CHR$ | also lets you "print" shadows and lines using text symbols... | &lt;br /&gt;+------+---------------------------------------------------------------+ &lt;br /&gt;the reverse of CHR$, the ASC function, gives you the code number for the &lt;br /&gt;first byte of a string:                                                  &lt;br /&gt;                                                                         &lt;br /&gt;? ASC("a") -3  _________________________________________________________ &lt;br /&gt;will print:    __94_____________________________________________________ &lt;br /&gt;               _________________________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;as ascii 97, in puppybasic coded as: CHR$(97) is "a", and 97 -3 is 94.       &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part i:  the indispensable                                       &lt;br /&gt;6 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;LEN... n = LEN(q$) will set n to a number equal to the number of bytes   &lt;br /&gt;in a string - examples: LEN("hello") is equal to 5, LEN("how are you?")  &lt;br /&gt;is equal to twelve. spaces and punctuation count.                        &lt;br /&gt;                                                                         &lt;br /&gt;lastly, as you can convert a string to a number using VAL, you can       &lt;br /&gt;convert a number to a string using STR$ so:                              &lt;br /&gt;                                                                         &lt;br /&gt;sp = 5                                                                   &lt;br /&gt;q$ = "you pressed spacebar" + STR$(sp-1) + "times."                      &lt;br /&gt;                                                                         &lt;br /&gt;will store the string: "you pressed spacebar 4 times." in q$.            &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;strings part i:  the indispensable                                       &lt;br /&gt;7 of 7                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;you are well on your way to learning puppybasic! the best thing you can &lt;br /&gt;do with this tutorial is read it slowly, think about each page and what  &lt;br /&gt;kind of program you could write with each command, and experiment with   &lt;br /&gt;the code in puppybasic (type it in, you learn faster that way, even &lt;br /&gt;though you *could* cut and paste...) for a feel of what coding is really &lt;br /&gt;like.  &lt;br /&gt;                                                                         &lt;br /&gt;and never forget to have fun.                                            &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 5 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                       (chapter 5) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-8490806458010195078?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/8490806458010195078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=8490806458010195078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8490806458010195078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8490806458010195078'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-05.html' title='puppybasic intro ch. 05 - strings part i'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-2433544636874448758</id><published>2007-02-02T15:20:00.001-08:00</published><updated>2007-02-02T17:41:44.184-08:00</updated><title type='text'>puppybasic intro ch. 04 - numbers are key</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;1 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 4: numbers are key                             &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;2 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;noooo! not math!                                                         &lt;br /&gt;                                                                         &lt;br /&gt;seriously, everything a computer does is enumerating and counting;       &lt;br /&gt;math can't be avoided, but most of the time it will not be painful.      &lt;br /&gt;in programming, colors are numbers, sounds are numbers, letters are      &lt;br /&gt;numbers, and numbers are the difference between a program that does      &lt;br /&gt;something and a program that doesn't; so here are some ways to work      &lt;br /&gt;with them...                                                             &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;3 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;first of all, operations: use of x+y adds the two, use of x-y            &lt;br /&gt;subtracts y from x, x*y gives the product, and a forward slash, "/"      &lt;br /&gt;will divide. exponents use the notation x^y, where x is raised to        &lt;br /&gt;the power of y.                                                          &lt;br /&gt;                                                                         &lt;br /&gt;math works well with variables:                                          &lt;br /&gt;                                                                         &lt;br /&gt;x = 7                                                                    &lt;br /&gt;y = x * 5            ___________________________________________________ &lt;br /&gt;PRINT "7 times 5 ="; _7 times 5 = 35____________________________________ &lt;br /&gt;PRINT y              ___________________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;4 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;you can use parentheses in puppybasic the same way you use them in           &lt;br /&gt;equations on paper, (except of course that you will want to enter        &lt;br /&gt;them with a keyboard, not a pencil.)                                     &lt;br /&gt;                                                                         &lt;br /&gt;moving on, ABS(x) automatically converts any value below zero to the     &lt;br /&gt;same value over zero, if you like. yes that's right, it just removes     &lt;br /&gt;the little line from a negative number.                                  &lt;br /&gt;                                                                         &lt;br /&gt;q = ABS((5 / 7) * -1) __________________________________________________ &lt;br /&gt;PRINT q               __.7142857________________________________________ &lt;br /&gt;                      __________________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;5 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;INT                                                                      &lt;br /&gt;                                                                         &lt;br /&gt;is similar in its simplicity to ABS but more likely to prove useful,     &lt;br /&gt;INT(x) does nothing to integers at all. if x is not an integer however,  &lt;br /&gt;INT will force it to become one, eliminating the fraction (or decimal).  &lt;br /&gt;chances are, if you stay with puppybasic you will be using this &lt;br /&gt;function, so go ahead and make yourselves aquainted.                                  &lt;br /&gt;                                                                         &lt;br /&gt;PRINT INT(7 / 3); INT(-4.9); INT(4.9) __________________________________ &lt;br /&gt;                                      __2_-5__4_________________________ &lt;br /&gt;                                      __________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;6 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;MOD                                                                      &lt;br /&gt;                                                                         &lt;br /&gt;is a weird function with a weird name. (it stands for "modulus.") it     &lt;br /&gt;forces a long set of numbers into a smaller set: say you have a number   &lt;br /&gt;like... 42 (and why wouldn't you?) but you want a number in the range    &lt;br /&gt;between 0 and 15, because the number is *supposed to* represent a        &lt;br /&gt;color. you could of course reject any number over 15 and set it as 15,   &lt;br /&gt;or you could instead say 42 MOD 16 (much, much more useful with          &lt;br /&gt;variables, and even loops or counters) which will invariably (heh)       &lt;br /&gt;give you a number in the range 0 to 15. let's illustrate with smaller    &lt;br /&gt;numbers and see if it makes sense:                                       &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;7 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;              ____________                                               &lt;br /&gt;PRINT 0 MOD 7 __0_________                                               &lt;br /&gt;PRINT 1 MOD 7 __1_________                                               &lt;br /&gt;PRINT 2 MOD 7 __2_________                                               &lt;br /&gt;PRINT 3 MOD 7 __3_________                                               &lt;br /&gt;PRINT 4 MOD 7 __4_________                                               &lt;br /&gt;PRINT 5 MOD 7 __5_________                                               &lt;br /&gt;PRINT 6 MOD 7 __6_________                                               &lt;br /&gt;PRINT 7 MOD 7 __0_________ again!                                        &lt;br /&gt;PRINT 8 MOD 7 __1_________                                               &lt;br /&gt;              ____________                                               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;8 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;the most fun you can have with modulus is in graphics routines, while    &lt;br /&gt;its best purpose may be handling (really) long division. if you never    &lt;br /&gt;use it, well, that's one less thing.                                     &lt;br /&gt;                                                                         &lt;br /&gt;i'll follow this odd numeric function with one that could be the hardest &lt;br /&gt;to avoid using...                                                        &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;9 of 14                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;VAL                                                                      &lt;br /&gt;                                                                         &lt;br /&gt;n = VAL(q$) turns the string q$ into the value n, so the string          &lt;br /&gt;" 0.557" becomes a simple .557, to the program: something which can      &lt;br /&gt;be added to, subtracted from, and otherwise used as a number, which      &lt;br /&gt;strings (otherwise) cannot. this is priceless when working with data     &lt;br /&gt;from files and the keyboard.                                             &lt;br /&gt;                                                                         &lt;br /&gt;q$ = "27a"                                  ____________________________ &lt;br /&gt;PRINT VAL("hi there"); VAL(q$); VAL("4.91") __0__27__4.91_______________ &lt;br /&gt;                                            ____________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;10 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;if you need a sufficiently "random" number, for dice, a "magic"          &lt;br /&gt;8-ball, or just a cool display on the screen, using the RND function     &lt;br /&gt;with INT and the number of "sides" you want:                             &lt;br /&gt;                                                                         &lt;br /&gt;n = INT(RND * 6)                                                         &lt;br /&gt;                                                                         &lt;br /&gt;will return a number 0 to 5, and you can have each number represent      &lt;br /&gt;the side of a die or anything you like.                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;11 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;prefer 1 to 6? why not?                                                  &lt;br /&gt;                                                                         &lt;br /&gt;n = INT(RND * 6 + 1)                                                     &lt;br /&gt;                                                                         &lt;br /&gt;will return numbers more specifically useful to dice. (you may be        &lt;br /&gt;thinking, "why not 'RND * 7'?", and the simple answer is "'cause it's    &lt;br /&gt;wrong!"                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;the useful answer is that RND * 6 + 1 produces a number of 6 possible    &lt;br /&gt;numbers, with 1 added to that number, but RND * 7 actually creates a     &lt;br /&gt;7-sided die, something i've never seen in my life.)                      &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;12 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;you will find that even if rolled 100 times, the 100 results you get     &lt;br /&gt;will be the same 100 results every time you use the program. to get      &lt;br /&gt;around this, the code RANDOMIZE TIMER will "seed" the RND function.      &lt;br /&gt;then all you have to do to roll the same dice twice is start at          &lt;br /&gt;precisely the same time of day as last time, to the millisecond,         &lt;br /&gt;accounting also for the fact that the clock circuit in your computer     &lt;br /&gt;is probably not as accurate a timepiece as your digital wristwatch,      &lt;br /&gt;even if you can set it from the atom clock: and good luck to you.        &lt;br /&gt;                                                                         &lt;br /&gt;RANDOMIZE TIMER                                                          &lt;br /&gt;? "this number will be random enough:"; INT(RND * 10)                    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;13 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;q = SGN(n)                                                               &lt;br /&gt;                                                                         &lt;br /&gt;will set q to -1 if n is less than 0, set q to 0 if n is 0, and set      &lt;br /&gt;q to 1 if n is more than 0. i've used this, but not that often.          &lt;br /&gt;                                                                         &lt;br /&gt;SQR(n)                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;is the square root of n, and is almost always easier to use than a       &lt;br /&gt;pencil and paper.                                                        &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;numbers are key                                                          &lt;br /&gt;14 of 14                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;i use these to do neat things with graphics, maybe you can find some     &lt;br /&gt;other use for trig. here are some of the trig functions:                 &lt;br /&gt;                                                                         &lt;br /&gt;cosine: COS(n)                                                           &lt;br /&gt;sine: SIN(n)                                                             &lt;br /&gt;tangent: i'm just thrilled with the program i made using this, it...     &lt;br /&gt;                                                                         &lt;br /&gt;sorry, i meant to say TAN(n)                                             &lt;br /&gt;n is the angle in radians. radians are equal to degrees * pi / 180.      &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 4 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                       (chapter 4) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-2433544636874448758?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/2433544636874448758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=2433544636874448758' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/2433544636874448758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/2433544636874448758'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-04.html' title='puppybasic intro ch. 04 - numbers are key'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-7945255376945978447</id><published>2007-02-02T15:18:00.000-08:00</published><updated>2007-02-02T17:40:06.861-08:00</updated><title type='text'>puppybasic intro ch. 03 - variables</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;variables                                                                &lt;br /&gt;1 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 3: variables                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;variables                                                                &lt;br /&gt;2 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;variables are the easiest way to store data in memory; of course, this   &lt;br /&gt;memory is cleared when the program ends or the machine is turned off,    &lt;br /&gt;but variables are useful when you want data in one part of your program  &lt;br /&gt;to be available to another line in the program.                          &lt;br /&gt;                                                                         &lt;br /&gt;there are two main types of variables: string and numeric.               &lt;br /&gt;                                                                         &lt;br /&gt;string variable names start with a letter and are made of letters and    &lt;br /&gt;numbers.                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;variables                                                                &lt;br /&gt;3 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;here is an example of a string variable at work:                         &lt;br /&gt;                                                                         &lt;br /&gt;q$="hello, world!"  ____________________________________________________ &lt;br /&gt;PRINT q$            _hello, world!______________________________________ &lt;br /&gt;PRINT q$            _hello, world!______________________________________ &lt;br /&gt;PRINT q$            _hello, world!______________________________________ &lt;br /&gt;PRINT q$            _hello, world!______________________________________ &lt;br /&gt;                    ____________________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;this prints the contents of the string variable q$ 4 times.              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;variables                                                                &lt;br /&gt;4 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;strings, like those used by the PRINT statement, start and end with a    &lt;br /&gt;double quote "like this." you cannot enter a string containing a double  &lt;br /&gt;quote:                                                                   &lt;br /&gt;"like "this example" does,"                                              &lt;br /&gt;                                                                         &lt;br /&gt;later on you'll learn a way around this using the CHR$ function.         &lt;br /&gt;                                                                         &lt;br /&gt;string variables almost always end in a dollar sign, while on the other  &lt;br /&gt;hand, numeric variables often end without in any special symbol, even    &lt;br /&gt;though there are other suffixes for specific types (which you usually    &lt;br /&gt;wont need... but you may want them.)                                     &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;variables                                                                &lt;br /&gt;5 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;all variables may be named with one or more letters, must start with a   &lt;br /&gt;letter, and may include numbers (q2$ or q2 for example) after that.      &lt;br /&gt;also, do not give a variable the same name as a statement or function    &lt;br /&gt;(like "CLS") if you want your program to work.                           &lt;br /&gt;                                                                         &lt;br /&gt;it's worth showing that you can print a mix of strings and numbers, like &lt;br /&gt;in the example on the next page...                                       &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;variables                                                                &lt;br /&gt;6 of 9                                                                   &lt;br /&gt;                          ______________________________________________ &lt;br /&gt;n=50                      __7 hello, world! 50 times.___________________ &lt;br /&gt;PRINT 7; q$; n; "times."  ______________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;...and you can combine two strings into one with the + sign like this:   &lt;br /&gt;                                                                         &lt;br /&gt;q$="hello"                                                               &lt;br /&gt;q$="oh, "+q$+" there..."                                                 &lt;br /&gt;                                                                         &lt;br /&gt;now the string "oh, hello there..." is stored in the variable q$.        &lt;br /&gt;combining strings this way, with or without variables, is called         &lt;br /&gt;"concatonization" and does not work with numeric variables.              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;variables                                                                &lt;br /&gt;7 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;there are a couple more things you might want to know before moving on:  &lt;br /&gt;it is often preferable (in the interest of time and effort) to type a    &lt;br /&gt;question mark:  ? "hello."                                               &lt;br /&gt;                                                                         &lt;br /&gt;instead of typing out PRINT, puppybasic will (along with many other          &lt;br /&gt;interpreters and compilers) change it to PRINT for you. it won't stop    &lt;br /&gt;you from using a question mark where you actually want one:              &lt;br /&gt;                                                                         &lt;br /&gt;? "do you want to quit?"                                                 &lt;br /&gt;will change to:                                                          &lt;br /&gt;PRINT "do you want to quit?"                                             &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;variables                                                                &lt;br /&gt;8 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;also, instead of giving each statement its own line, you may often find  &lt;br /&gt;you prefer to combine lines of code using a colon :                      &lt;br /&gt;                                                                         &lt;br /&gt;CLS: PRINT "to whom it may concern"; : PRINT ":"                         &lt;br /&gt;                                                                         &lt;br /&gt;will clear the screen and PRINT the following:                           &lt;br /&gt;                                                                         &lt;br /&gt;________________________________________________________________________ &lt;br /&gt;_to whom it may concern:________________________________________________ &lt;br /&gt;________________________________________________________________________ &lt;br /&gt;________________________________________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;variables                                                                &lt;br /&gt;9 of 9                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;COLOR 10: PRINT "dear abby"; : PRINT ","                                 &lt;br /&gt;                                                                         &lt;br /&gt;will print:  ___________________________________________________________ &lt;br /&gt;             _dear abby,________________________________________________ &lt;br /&gt;             ___________________________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;congratulations! if you have not already, you can now write your first   &lt;br /&gt;puppybasic program. you will be able to do much more after reading the  &lt;br /&gt;next section.                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 3 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                       (chapter 3) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-7945255376945978447?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/7945255376945978447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=7945255376945978447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7945255376945978447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7945255376945978447'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-03.html' title='puppybasic intro ch. 03 - variables'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-7881565383919916033</id><published>2007-02-02T15:17:00.000-08:00</published><updated>2007-02-02T17:38:18.236-08:00</updated><title type='text'>puppybasic intro ch. 02- learning puppybasic</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;1 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                                 &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 2: learning puppybasic                             &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;2 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;when learning any programming language, the first thing to look at is a  &lt;br /&gt;good tutorial, if one is available. most tutorials will include some     &lt;br /&gt;variation of a "hello world" program, or a program to simply make the    &lt;br /&gt;computer say "hello, world!" on the screen. the second thing to look at  &lt;br /&gt;when learning a new language is program examples, where "hello, world"   &lt;br /&gt;might be the most simple.                                                &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;3 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;true to the name, b.a.s.i.c makes pretty easy work of this:                                                       &lt;br /&gt;                                                                         &lt;br /&gt;10 PRINT "hello, world!"  ______________________________________________ &lt;br /&gt;20 END                    _hello, world!________________________________ &lt;br /&gt;                          ______________________________________________ &lt;br /&gt;                          ______________________________________________ &lt;br /&gt;                          ______________________________________________ &lt;br /&gt;                          ______________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;4 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;that was the old way, that is, every line required a line number. in     &lt;br /&gt;puppybasic, line numbers really don't work, and aren't needed.&lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;5 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;here is a more "modern" version of the code:                             &lt;br /&gt;                                                                         &lt;br /&gt;PRINT "hello, world!"                                                    &lt;br /&gt;END                                                                      &lt;br /&gt;                                                                         &lt;br /&gt;not much difference there, of course you'll need a new way to reference &lt;br /&gt;a position inside the code, but puppybasic has several, don't worry.    &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;6 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;the PRINT statement, which should probably be called ECHO, like it is in &lt;br /&gt;dos, "prints" to the screen. of course, before everyone had crt's (or    &lt;br /&gt;lcd's) attached to their computers, the "screen" was a teletype, or an   &lt;br /&gt;electric printer-keyboard combo similar enough to a typewriter, so maybe &lt;br /&gt;"print" wasn't too odd a thing to call it.                               &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;7 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;the statement for printing to a printer incidentally, is LPRINT, of      &lt;br /&gt;course this is essentially part of a dos system; not only does windows   &lt;br /&gt;sometimes create problems when using LPRINT, but without windows, LPRINT &lt;br /&gt;will not print to some newer models of printers (i saw lexmark abandon   &lt;br /&gt;pure-dos compatibility first, though it could have been someone else)    &lt;br /&gt;and of course, will not print to usb printers. (it is possible to access &lt;br /&gt;some usb devices from dos without running windows. it is very, very      &lt;br /&gt;tricky.)                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;8 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;the END statement simply ends the program. if there is code after the    &lt;br /&gt;END statement, it will not run unless you specifically tell another part &lt;br /&gt;of the program to go there.                                              &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;9 of 15                                                                  &lt;br /&gt;                                                                         &lt;br /&gt;if you tell the computer to PRINT again, it will print on the next       &lt;br /&gt;line... so the following code:                                           &lt;br /&gt;                                                                         &lt;br /&gt;PRINT "hello, world!"                                                    &lt;br /&gt;PRINT "how are you?"                                                     &lt;br /&gt;END                                                                      &lt;br /&gt;                                       _________________________________ &lt;br /&gt;would end up like this on the screen:  _hello, world!___________________ &lt;br /&gt;                                       _how are you?____________________ &lt;br /&gt;                                       _________________________________ &lt;br /&gt;                                       _________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;10 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;if you don't want it to go to the next line, try putting a semicolon     &lt;br /&gt;outside the quote marks to the line you want to add to:                  &lt;br /&gt;                                                                         &lt;br /&gt;PRINT "hello, world!";                                                   &lt;br /&gt;PRINT "how are you?"                                                     &lt;br /&gt;                                  ______________________________________ &lt;br /&gt;which will instead produce this:  _hello, world!how are you?____________ &lt;br /&gt;                                  ______________________________________ &lt;br /&gt;you can add spaces as you like.   ______________________________________ &lt;br /&gt;                                  ______________________________________ &lt;br /&gt;                                  ______________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;11 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;you may end up with a lot of "hello" on one screen, or you may simply    &lt;br /&gt;want to start fresh. this command:                                       &lt;br /&gt;                                                                         &lt;br /&gt;CLS                                                                      &lt;br /&gt;                                                                         &lt;br /&gt;stands for "clear screen" and is a common way to start a program.        &lt;br /&gt;                                                                         &lt;br /&gt;CLS                                                                      &lt;br /&gt;PRINT "hello!"                                                           &lt;br /&gt;                                                                         &lt;br /&gt;but you want more fun to really appreciate programming. let's add color. &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;12 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;basic and puppybasic are not limited to text, but text-related functions  &lt;br /&gt;are worth covering first, since they're usually easier to code and since&lt;br /&gt;you can't get away from them all, even if you're writing a gui util. &lt;br /&gt;                                                                         &lt;br /&gt;changing the color is easy enough, if you know how.                       &lt;br /&gt;let's try this:                                                          &lt;br /&gt;                 _______________________________________________________ &lt;br /&gt;CLS              _BLUE!_________________________________________________ &lt;br /&gt;COLOR 1          _______________________________________________________ &lt;br /&gt;PRINT "BLUE!"    _______________________________________________________ &lt;br /&gt;                 _______________________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;13 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;and that's what that does. colors are represented by numbers, and in the &lt;br /&gt;default text-only mode there are about sixteen of them.                  &lt;br /&gt;                                                                         &lt;br /&gt;here's a table:                                                          &lt;br /&gt;                                                                         &lt;br /&gt;0                                                                        &lt;br /&gt;black   1 blue  2 green  3 cyan  4 red  5 magenta  6 brown 7 white       &lt;br /&gt;                                                                         &lt;br /&gt;8       9       10       11      12     13         14      15            &lt;br /&gt;grey    l.blue  l.green  l.cyan  l.red  l.magenta  yellow  bright-white  &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;14 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;you can even change colors before you go to the next letter:             &lt;br /&gt;COLOR 2                                                                  &lt;br /&gt;PRINT "h";  ____________________________________________________________ &lt;br /&gt;COLOR 3     _hello______________________________________________________ &lt;br /&gt;PRINT "e";  ____________________________________________________________ &lt;br /&gt;COLOR 5     ____________________________________________________________ &lt;br /&gt;PRINT "l";  ____________________________________________________________ &lt;br /&gt;COLOR 4     ____________________________________________________________ &lt;br /&gt;PRINT "l";  ____________________________________________________________ &lt;br /&gt;COLOR 1     ____________________________________________________________ &lt;br /&gt;PRINT "o"   ____________________________________________________________ &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;learning puppybasic                                                          &lt;br /&gt;15 of 15                                                                 &lt;br /&gt;                                                                         &lt;br /&gt;so you dont get confused when you see people use it, PRINT without any   &lt;br /&gt;string or number or variable just prints a blank line (or stops adding   &lt;br /&gt;to the end of a PRINT statement with a semicolon on the end.)            &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 2 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                       (chapter 2) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-7881565383919916033?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/7881565383919916033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=7881565383919916033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7881565383919916033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7881565383919916033'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-02.html' title='puppybasic intro ch. 02- learning puppybasic'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-265508294465652798</id><published>2007-02-02T15:12:00.000-08:00</published><updated>2007-02-02T17:35:44.462-08:00</updated><title type='text'>puppybasic intro ch. 01 - what exactly is puppybasic?</title><content type='html'>&lt;pre&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.&lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;what exactly is puppybasic?                                                  &lt;br /&gt;1 of 4                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                  an intro to puppybasic                       &lt;br /&gt;                                                                         &lt;br /&gt;                  chapter 1: what exactly is puppybasic?                     &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;what exactly is puppybasic?                                                  &lt;br /&gt;2 of 4                                                                  &lt;br /&gt;                                                                        &lt;br /&gt;puppybasic is a program interpreter for basic scripts, included with&lt;br /&gt;puppylinux. it was developed from wx-basicscript by mark ulrich and &lt;br /&gt;jerry muelver, which in turn is based on wxbasic by david cuny.&lt;br /&gt;&lt;br /&gt;puppybasic enables the creation of scripts that access the terminal,&lt;br /&gt;files, and gui dialogs in a way that even beginners can toy with.&lt;br /&gt;&lt;br /&gt;puppybasic lets almost anyone "write small, simple programs... without &lt;br /&gt;the elegance of huger languages (but [is so much] easier to use)." &lt;br /&gt;being mindful of its limitations, it is worth seeing some the &lt;br /&gt;lightweight utilities created using puppybasic. many of them call more&lt;br /&gt;powerful apps that were written in c, but allow a quick, easy, and even&lt;br /&gt;attractive interface to be built over, or between them.&lt;br /&gt;&lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;what exactly is puppybasic?                                                  &lt;br /&gt;3 of 4                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;it can also be a lot of fun, and this tutorial was greated to help the &lt;br /&gt;reader get a foot in the door, and learn to have a bit of fun, tweaking&lt;br /&gt;code and telling the computer exactly what to do. &lt;br /&gt;&lt;br /&gt;(a note: this tutorial is currently designed as an intro to programming,&lt;br /&gt;and may not delve into creating gui's. however, a puppybasic tutorial&lt;br /&gt;exists for that very task, elsewhere.)&lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;........................................................................ &lt;br /&gt;what exactly is puppybasic?                                                  &lt;br /&gt;4 of 4                                                                   &lt;br /&gt;                                                                         &lt;br /&gt;b.a.s.i.c. itself was designed to make programming more accessible to    &lt;br /&gt;newcomers, and is probably the friendliest programming language there    &lt;br /&gt;is. created at dartmouth college, it is a major part of a decades-long&lt;br /&gt;tradition of hobby programming, and countless books and websites&lt;br /&gt;include b.a.s.i.c. source code for you to try out on your computer.             &lt;br /&gt;while basic has gone through a number of changes over the years, one     &lt;br /&gt;thing is common throughout all good implementations: relative &lt;br /&gt;simplicity. this tutorial can offer you your first, second, or tenth&lt;br /&gt;taste of basic programming, and help you use some of what you've &lt;br /&gt;learned, or are learning, in puppylinux.        &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                         -= end of chapter 1 =-                          &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;                                                                         &lt;br /&gt;........................................................................ &lt;br /&gt;an intro to puppybasic                                       (chapter 1) &lt;br /&gt;this content is public domain.                          &lt;br /&gt;........................................................................ &lt;br /&gt;&lt;br /&gt;&lt;a href="http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html"&gt;click here&lt;/a&gt; to go back to the contents page&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-265508294465652798?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/265508294465652798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=265508294465652798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/265508294465652798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/265508294465652798'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-01.html' title='puppybasic intro ch. 01 - what exactly is puppybasic?'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-6077225583185883496</id><published>2007-02-02T15:07:00.000-08:00</published><updated>2007-02-02T16:51:28.456-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='puppybasic'/><title type='text'>an intro to puppybasic</title><content type='html'>&lt;pre&gt;this is the first stage of a large tutorial for &lt;br /&gt;programming in basic. it's being reworked for  &lt;br /&gt;puppybasic and was originally written for qbasic.  &lt;br /&gt;&lt;span style="color: orange;"&gt;this puppybasic tutorial is public domain, and may be  &lt;br /&gt;edited, quoted, and redistributed freely.&lt;/span&gt;  &lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;green text is being edited and should not be considered  &lt;br /&gt;relevant to the tutorial.&lt;/span&gt; for a while, it will make up  &lt;br /&gt;the bulk of this section.&lt;br /&gt;  &lt;br /&gt;black text has been edited to be more accurate with  &lt;br /&gt;regards to puppybasic.  &lt;br /&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;&lt;span style="color: black;"&gt;&amp;#9608;&lt;/span&gt; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-01.html"&gt;chapter 01: what exactly is puppybasic?&lt;/a&gt;  &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-02.html"&gt;chapter 02: learning puppybasic&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-03.html"&gt;chapter 03: variables&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-04.html"&gt;chapter 04: numbers are key&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-05.html"&gt;chapter 05: strings part i&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-06.html"&gt;chapter 06: more with text&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-07.html"&gt;chapter 07: keyboard and data lines&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-08.html"&gt;chapter 08: strings part ii&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-09.html"&gt;chapter 09: working with binary files&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-10.html"&gt;chapter 10: branching within the program&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-11.html"&gt;chapter 11: decision making&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-12.html"&gt;chapter 12: looping within the program&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-13.html"&gt;chapter 13: working with text files&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-14.html"&gt;chapter 14: errors&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-15.html"&gt;chapter 15: timing&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-16.html"&gt;chapter 16: arrays&lt;/a&gt; &lt;br /&gt;&amp;#8226; &lt;a href="http://puppydocblognode1.blogspot.com/2007/02/puppybasic-intro-chapter-17.html"&gt;chapter 17: other useful statements&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-6077225583185883496?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/6077225583185883496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=6077225583185883496' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/6077225583185883496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/6077225583185883496'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/02/intro-to-puppybasic.html' title='an intro to puppybasic'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-6221553478553484096</id><published>2007-01-22T01:06:00.000-08:00</published><updated>2007-01-22T01:21:38.473-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='1.07'/><category scheme='http://www.blogger.com/atom/ns#' term='pupwin98'/><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><category scheme='http://www.blogger.com/atom/ns#' term='upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='2.11'/><title type='text'>howto upgrade pupwin98 to 2.11</title><content type='html'>&lt;span class="postbody"&gt;note: you can in fact get the necessary files to do this without downloading TWO 60-70mb files. pup4dos does what pupwin98 does... but i already have pupwin98 (which is puppy 1.07 so you know) and i still like it a lot. here's how to use it with dos grub (slightly different than  pup4dos!) and the 2.11 files:&lt;br /&gt;&lt;br /&gt;*assuming you don't have a puppy 2.11 cd: &lt;br /&gt;&lt;br /&gt;you'll have to extract the files from the .iso file. in 2.11 (catch 22, but good for future versions?) this can probably be done in iso editor? in windows, 7zip can extract iso files. in puppy 1.07, .iso files can be mounted with qemu or dosbox. see the forum / wiki posts for details.&lt;br /&gt;&lt;br /&gt;*assuming you do have a puppy 2.11 cd:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. if you don't want  the win98 screen on&lt;br /&gt;startup anymore, type ECHO. &gt; \logo.sys&lt;br /&gt;in dos.&lt;br /&gt;&lt;br /&gt;2. copy the pup_211.sfs on the cd to \&lt;br /&gt;&lt;br /&gt;3. rename \puppy\vmlinuz to vmlinuz.1&lt;br /&gt;copy the vmlinuz on the cd to \puppy &lt;br /&gt;&lt;br /&gt;4. copy initrd.gz from the cd to \puppy&lt;br /&gt;&lt;br /&gt;5. copy menu.lst to menu.txt&lt;br /&gt;open menu.lst in a text editor:&lt;br /&gt;change "image.gz" to "initrd.gz"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;that should do it!&lt;br /&gt;&lt;br /&gt;so far, the reasons i am considering upgrading my machine from 1.07 to 2.11:&lt;br /&gt;&lt;br /&gt;* puppybasic goes from older version to 2.5 (it's a .pup too though i think)&lt;br /&gt;* better hardware support (i have a usb key that didn't work with 1.07)&lt;br /&gt;* the taskbar now includes icons / for show desktop / console / editor &lt;br /&gt;* the taskbar now shows how much free ram (or is it ramdisk?) you have &lt;br /&gt;* iso editor !!!!&lt;br /&gt;* some of the control panel apps have dramatically improved&lt;br /&gt;* new 2.6.x kernel&lt;br /&gt;&lt;br /&gt;the newer version IS slightly slower than 1.07. on old hardware, it's something to consider. however, 2.11 will work on a wider variety of newer *and* older hardware... (the kernel in 1.07 may still be better for some older machines.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ktwi: puppy 1.07 -&gt; 2.11, probably versions of puppy 2.x prior to 2.11 also, but not 2.12 or later (haven't tried this with zdrv yet.)&lt;br /&gt;&lt;br /&gt;thanks to: nevermore, amish&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-6221553478553484096?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/6221553478553484096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=6221553478553484096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/6221553478553484096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/6221553478553484096'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/howto-upgrade-pupwin98-to-211.html' title='howto upgrade pupwin98 to 2.11'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-5585578725506233537</id><published>2007-01-20T22:06:00.000-08:00</published><updated>2007-01-20T22:24:25.919-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fvwm95'/><category scheme='http://www.blogger.com/atom/ns#' term='clock'/><category scheme='http://www.blogger.com/atom/ns#' term='jwm'/><category scheme='http://www.blogger.com/atom/ns#' term='24hr'/><category scheme='http://www.blogger.com/atom/ns#' term='12hr'/><title type='text'>change clock from 24hr to 12hr in jwm and fvwm95</title><content type='html'>&lt;span style="font-weight: bold;"&gt;in jwm:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. open the /root/.jwmrc-tray using a text editor (beaver or leafpad)&lt;br /&gt;&lt;br /&gt;2. then modify this tag ---&amp;gt;   &amp;lt;Clock&amp;gt;minixcal&amp;lt;/Clock&amp;gt;&lt;br /&gt;&lt;br /&gt;3. to be like this: &amp;lt;Clock format="%I:%M %p"&amp;gt;minixcal&amp;lt;/Clock&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in fvwm95:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. .fvwm95rc has a string like this *FvwmTaskBarShowDateModuleClockFormat.DATE %H:%M&lt;br /&gt;&lt;br /&gt;2.  edit that so that %H is %I instead: *FvwmTaskBarShowDateModuleClockFormat.DATE %I:%M  for a 12 hour clock in FVWM95&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ktwi: puppy 2.12 (probably most other puppy versions as well) with the jwm and fvwm95 window managers&lt;br /&gt;&lt;br /&gt;thanks to: rarsa, billthefish&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-5585578725506233537?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/5585578725506233537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=5585578725506233537' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/5585578725506233537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/5585578725506233537'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/change-from-24hr-to-12hr-in-jwm-and.html' title='change clock from 24hr to 12hr in jwm and fvwm95'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-1463590691878273908</id><published>2007-01-20T05:48:00.000-08:00</published><updated>2007-02-02T14:46:30.822-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rox'/><category scheme='http://www.blogger.com/atom/ns#' term='pager'/><category scheme='http://www.blogger.com/atom/ns#' term='leafpad'/><category scheme='http://www.blogger.com/atom/ns#' term='desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='jwm'/><category scheme='http://www.blogger.com/atom/ns#' term='rxvt'/><category scheme='http://www.blogger.com/atom/ns#' term='dillo'/><category scheme='http://www.blogger.com/atom/ns#' term='mtpaint'/><category scheme='http://www.blogger.com/atom/ns#' term='taskbar'/><category scheme='http://www.blogger.com/atom/ns#' term='screenshot'/><category scheme='http://www.blogger.com/atom/ns#' term='blinky'/><category scheme='http://www.blogger.com/atom/ns#' term='2.11'/><title type='text'>puppylinux: screenshot anatomy</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_1Bds01KqMfA/RbIhvncZcdI/AAAAAAAAAAM/U1p_8ETQVEA/s1600-h/screen.png" target="_blank"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_1Bds01KqMfA/RbIhvncZcdI/AAAAAAAAAAM/U1p_8ETQVEA/s400/screen.png" alt="view slightly larger" title="view slightly larger" id="BLOGGER_PHOTO_ID_5022113636397183442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;clockwise, from top right:&lt;/span&gt; rxvt, dillo, rox-filer, leafpad, mtpaint&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;rxvt:&lt;/span&gt; terminal window&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;dillo:&lt;/span&gt; lightweight web browser (not shown: seamonkey)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;rox-filer:&lt;/span&gt; file manager&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mtpaint:&lt;/span&gt; used to make this screenshot&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;leafpad:&lt;/span&gt; you will probably never find a linux app closer to (it's debatably better than) notepad&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;desktop:&lt;/span&gt; rox desktop (part of rox-filer)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;taskbar&lt;/span&gt; (feature of joe's window manager/jwm)&lt;span style="font-weight: bold;"&gt; from left:&lt;/span&gt; menu button, buttons for "show desktop", rxvt, editor... pager: shows which desktop is active... buttons for each program open on the current desktop...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;also on taskbar (right):&lt;/span&gt; volume, freememapplet (blue monitor free ramdisk or free savefile), xload (cpu usage) and clock.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ktwi: this is a screenshot of puppylinux 2.11, some of the features on the taskbar aren't available in puppy 1.x. "show desktop" doesn't work properly in version 2.13 with the newer rox-filer 2.5.&lt;br /&gt;&lt;br /&gt;thanks to: bloodhound, amish&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-1463590691878273908?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/1463590691878273908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=1463590691878273908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/1463590691878273908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/1463590691878273908'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/puppylinux-screenshot-anatomy.html' title='puppylinux: screenshot anatomy'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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://4.bp.blogspot.com/_1Bds01KqMfA/RbIhvncZcdI/AAAAAAAAAAM/U1p_8ETQVEA/s72-c/screen.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465258041713689505.post-8724250960852896547</id><published>2007-01-17T03:08:00.000-08:00</published><updated>2007-01-17T03:17:49.084-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><category scheme='http://www.blogger.com/atom/ns#' term='2.13'/><title type='text'>puppy 2.13 bugs and workarounds</title><content type='html'>as with ubuntu, redhat, and certainly windows, puppy doesn't always do exactly what you'd expect it to. sometimes you messed up, and sometimes puppy messed up. it may surprise some people that puppy isn't perfect, because sometimes it comes really close!&lt;br /&gt;&lt;br /&gt;and here's a list of niggling things that should possibly, or can easily, be repaired... or at least worked with. when possible, they will be followed by tips to help you (and maybe even devs) tweak, fiddle, and improve with the least effort possible.&lt;br /&gt;&lt;br /&gt;thanks to those that contribute, and thanks for your patience. we do it because generally, we love puppy. so here are some bugs, and other bug-like items, (and hopefully workarounds!) found in puppy 2.13. you have to find them to fix them!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;"show desktop" feature in jwm incompatible with rox 2.5&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;, button disabled&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;at a guess, this may mean either that the "show desktop" button on the taskbar will NOT close rox windows, or that using the "show desktop" button will hide the rox desktop icons as well. &lt;span style="font-weight: bold;"&gt;not yet tried: &lt;/span&gt;enabling the button, via /root/.jwmrc-tray (it's still there, but commented out) to see what happens.&lt;br /&gt;&lt;br /&gt;if you don't use icons on the desktop, or have removed them, or you don't use rox filer for file management, this "bug" may not affect you.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ktwi: these fixes should apply to puppy 2.13, and some will likely work in other versions.&lt;br /&gt;&lt;br /&gt;thanks to: maurelius, amish&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-8724250960852896547?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/8724250960852896547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=8724250960852896547' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8724250960852896547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8724250960852896547'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/puppy-213-bugs-and-workarounds.html' title='puppy 2.13 bugs and workarounds'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465258041713689505.post-5166068641605943457</id><published>2007-01-16T00:46:00.000-08:00</published><updated>2007-01-17T15:12:56.530-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='2.12'/><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>puppy 2.12 bugs and workarounds</title><content type='html'>as with ubuntu, redhat, and certainly windows, puppy doesn't always do exactly what you'd expect it to. sometimes you messed up, and sometimes puppy messed up. it may surprise some people that puppy isn't perfect, because sometimes it comes really close!&lt;br /&gt;&lt;br /&gt;and here's a list of niggling things that should possibly, or can easily, be repaired... or at least worked with. when possible, they will be followed by tips to help you (and maybe even devs) tweak, fiddle, and improve with the least effort possible.&lt;br /&gt;&lt;br /&gt;thanks to those that contribute, and thanks for your patience. we do it because generally, we love puppy. so here are some bugs, and other bug-like items, (and hopefully workarounds!) found in puppy 2.12. you have to find them to fix them!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;broken links in the help system&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;The help icon on the desktop leads to several (not all of them, at least) broken online and offline links, in Puppy 2.12 and likely a number of other versions.&lt;br /&gt;&lt;br /&gt;Future workaround: alienjeff has started to compile a list of these broken links and provide a workaround when possible.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Meanwhile&lt;/span&gt;: all pages that do load properly offline should be available from your browser at: &lt;a href="file:///usr/share/doc"&gt;file:///usr/share/doc&lt;/a&gt; &lt;- local link, only available within puppylinux&lt;br /&gt;&lt;a href="file:///usr/share/doc"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;ktwi: these fixes should apply to puppy 2.12, and some will likely work in other versions.&lt;br /&gt;&lt;br /&gt;thanks to: alienjeff, amish&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-5166068641605943457?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/5166068641605943457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=5166068641605943457' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/5166068641605943457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/5166068641605943457'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/puppy-212-bugs-and-workarounds.html' title='puppy 2.12 bugs and workarounds'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465258041713689505.post-8169514321569420756</id><published>2007-01-14T19:47:00.000-08:00</published><updated>2007-01-16T02:14:32.185-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='default'/><category scheme='http://www.blogger.com/atom/ns#' term='editor'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>changing defaultbrowser or texteditor</title><content type='html'>&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;icons on the desktop and commands like "defaultbrowser" on the command line and in scripts rely on default scripts that call the utilities (such as the web browser and text editor) to open them. the thing is, "defaultbrowser" can be changed to any browser you have installed, as can defaulttexteditor.&lt;br /&gt;&lt;br /&gt;being able to change the defaults is very useful when for instance, you're right clicking on a text file to open it, or opening a webpage.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;1a. opening the file using the terminal:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;enter the following:&lt;br /&gt;leafpad /usr/local/bin/defaultbrowser &amp;&lt;br /&gt;&lt;br /&gt;or this:&lt;br /&gt;leafpad /usr/local/bin/defaulttexteditor &amp;amp;&lt;br /&gt;&lt;br /&gt;making sure there is a space after "leafpad" and a space before "&amp;"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1b. opening the file using rox:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;click the "home" icon on the desktop to run rox-filer, then the up arrow (or triangle) icon in the rox toolbar to go to the / directory. click the folder icons for /usr, local, and bin, then find the icon for defaultbrowser. right click, select and "open as text"&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;(note that you can drag most of these icons onto the desktop.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. editing the file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;it will look something like this:&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;exec &lt;span style="font-weight: bold;"&gt;opera&lt;/span&gt; "$@"&lt;br /&gt;&lt;br /&gt;"opera" may be "mozstart" in either case, whatever you type in a terminal to start your browser, for instance:&lt;br /&gt;&lt;br /&gt;firefox&lt;br /&gt;&lt;br /&gt;should work here as well. so the new file will be:&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;exec &lt;span style="font-weight: bold;"&gt;firefox&lt;/span&gt; "$@"&lt;br /&gt;&lt;br /&gt;save the file and close the editor, and that's it!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;for defaulttexteditor:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;same as for the browser- the part you should change will probably be geany, beaver, or leafpad. simply replace with the name of the one you want as default, or with the name of whatever alternative you have installed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;most default... scripts work this way. just remember to leave as much of the text intact as possible, only change the part you have to.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;still another way:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;pizzasgood has created a utility named defaults-wizard to handle defaultscripts like these. it's available at: &lt;a href="http://murga-linux.com/puppy/viewtopic.php?t=13429"&gt;http://murga-linux.com/puppy/viewtopic.php?t=13429&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;download this, restart ice window manager or jwm from the shutdown or logoff menu, open it from the menu and click the name of the file you want to change. use the file window to locate the program you want as default.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ktwi: grafpup 104, should work in most versions of grafpup and puppy 1.x, puppy 2.x&lt;br /&gt;&lt;br /&gt;thanks to: rarsa, amish&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-8169514321569420756?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/8169514321569420756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=8169514321569420756' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8169514321569420756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8169514321569420756'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/changing-defaultbrowser-or-texteditor.html' title='changing defaultbrowser or texteditor'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-7386208782835443449</id><published>2007-01-13T18:47:00.000-08:00</published><updated>2007-02-02T13:46:07.250-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='podcasts'/><category scheme='http://www.blogger.com/atom/ns#' term='wiki'/><category scheme='http://www.blogger.com/atom/ns#' term='forums'/><category scheme='http://www.blogger.com/atom/ns#' term='documentation'/><category scheme='http://www.blogger.com/atom/ns#' term='distros'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='mirrors'/><category scheme='http://www.blogger.com/atom/ns#' term='pawedcasts'/><category scheme='http://www.blogger.com/atom/ns#' term='downloads'/><category scheme='http://www.blogger.com/atom/ns#' term='pupweb'/><title type='text'>the pupweb</title><content type='html'>&lt;span style="font-weight: bold;"&gt;what is the "pupweb?"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;for starters, there is a site at &lt;a href="http://pupweb.org/"&gt;http://pupweb.org&lt;/a&gt; providing a convenient "one-stop" url for the biggest sites related to puppylinux.&lt;br /&gt;&lt;br /&gt;if the term were to be borrowed from there, it could be applied to all puppylinux sites collectively. and why not?&lt;br /&gt;&lt;br /&gt;assuming that has already taken place, the "pupweb" is the collective of all sites related to puppylinux. some have software, some have documentation, some have distros and patches, and some have other things, such as "pawedcasts" - which are soundfiles you can download and listen to, similar (similar enough) to the radio.&lt;br /&gt;&lt;br /&gt;if you have a site with puppylinux content, even a single page, please do feel free to post it in a comment below. reviews of puppy are also welcome.&lt;br /&gt;&lt;br /&gt;each section below will link to as many sites as possible, and ideally, most sections will have a page on this blog that goes into more detail about each one. for instance: "distros" will attempt to link to all pages that mirror puppy distros, but it would be nice to have a page that even links to images on those mirrors and/or describes the different ones available.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="distros"&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;distros** &lt;/span&gt;(and mirrors)&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;a href="http://puppyos.com/"&gt;&lt;span&gt;http://puppyos.com&lt;/span&gt;&lt;/a&gt; (the site of puppy creator barry kauler)&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;a href="http://pupweb.org/"&gt;http://pupweb.org&lt;/a&gt;&lt;span&gt; | &lt;/span&gt;&lt;a href="http://grafpup.com/"&gt;&lt;span&gt;http://grafpup.com&lt;/span&gt;&lt;/a&gt; | &lt;a href="http://edupup.org/"&gt;http://edupup.org&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.puptrix.org/"&gt;http://www.puptrix.org&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://puppyfiles.org/isos/" target="_blank"&gt;http://puppyfiles.org/isos/&lt;/a&gt; (home to muppy and barelypup 2.13)&lt;br /&gt;&lt;a href="ftp://ibiblio.org/pub/linux/distributions/puppylinux/"&gt;ftp://ibiblio.org/pub/linux/distributions/puppylinux/&lt;/a&gt;&lt;span&gt; (main downloads)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;forums&lt;br /&gt;&lt;/span&gt;&lt;a href="http://pupweb.org/"&gt;http://pupweb.org&lt;/a&gt; | &lt;a href="http://murga-liinux.org/puppy"&gt;http://murga-linux.com/puppy&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;documentation&lt;br /&gt;&lt;/span&gt;&lt;a href="http://pupweb.org/"&gt;http://pupweb.org&lt;/a&gt;&lt;br /&gt;puppy linux documentation project: &lt;a href="http://puppylinux.org/docs/"&gt;http://puppylinux.org/docs&lt;/a&gt;&lt;br /&gt;official wiki: &lt;a href="http://www.puppylinux.org/wikka"&gt;http://www.puppylinux.org/wikka&lt;/a&gt;&lt;br /&gt;rhino's video tuts: &lt;a href="http://rhinoweb.us/"&gt;http://rhinoweb.us&lt;/a&gt;&lt;br /&gt;klh's stickwiki: &lt;a href="http://www.greenvilleroad.com/PuppyGuide-1.html"&gt;&lt;span&gt;&lt;span&gt;http://www.GreenvilleRoad.com/PuppyGuide-1.html&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;lobster's docs: &lt;a href="http://tmxxine.com/pm"&gt;http://tmxxine.com/pm&lt;/a&gt; and wiki: &lt;a href="http://tmxxine.com/Wikka/wikka.php?wakka=PuppyLinux"&gt;http://tmxxine.com/Wikka/wikka.php?wakka=PuppyLinux&lt;/a&gt;&lt;br /&gt;deutsches handbuch durch oli&lt;span class="postbody"&gt;: &lt;/span&gt; (also in english) &lt;a href="http://puppy-linux.info/"&gt;http://puppy-linux.info&lt;/a&gt;&lt;br /&gt;howto section of murga's forum: &lt;a href="http://murga-linux.com/puppy/index.php?f=4"&gt;http://murga-linux.com/puppy/index.php?f=4&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;software &lt;/span&gt;&lt;/span&gt;(packages, other downloads)&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://pupweb.org/"&gt;http://pupweb.org&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;pawedcasts&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="text-decoration: underline;"&gt;&lt;a href="http://dotpups.de/podcasts"&gt;http://dotpups.de/podcasts&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://tmxxine.org/pawedcasts"&gt;http://puppylinux.org/wikka/PawCasting&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;** it's worth noting that "distros" (plural) is being used here to describe multiple versions of puppy, and things based on puppy... some may be "distros" in their own right, and others only in a loose sense of the word, but if it's a version of puppy or based on puppy, or mirrors puppy iso's, it can be listed here.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;ktwi: applies to all versions at different times&lt;br /&gt;&lt;br /&gt;thanks to: ndujoe, lobstered, alienjeff, amish&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&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/2465258041713689505-7386208782835443449?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/7386208782835443449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=7386208782835443449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7386208782835443449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/7386208782835443449'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/pupweb.html' title='the pupweb'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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-2465258041713689505.post-8341175174057023603</id><published>2007-01-12T07:38:00.000-08:00</published><updated>2007-01-17T13:28:48.082-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><category scheme='http://www.blogger.com/atom/ns#' term='dos'/><title type='text'>bash howto for dos lovers</title><content type='html'>the following is aimed at dos users that are not already extremely comfortable with the command line interface (cli) in linux, and also may be useful to linux users that aren't already extremely comfortable with the dos cli, and should be useful without or in xwin.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;attrib&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;attrib *.*&lt;br /&gt;# shows attributes of all files a h r s (archive hidden readonly system)&lt;br /&gt;attrib *.txt +a&lt;br /&gt;# set all txt files to have archive attribute (*.* applies only to current folder)&lt;br /&gt;attrib *.* -a -h -r -s&lt;br /&gt;# remove all attributes from all files&lt;br /&gt;# (if you cant change attributes in dos the file is locked, or, remove -a -h -r -s at once)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;chmod&lt;br /&gt;(and/or)&lt;br /&gt;chattr&lt;br /&gt;(and/or)&lt;br /&gt;chown&lt;br /&gt;examples:&lt;br /&gt;chmod 777 hello.sh&lt;br /&gt;# makes it so everyone can read, write, or run a file (as an executable)&lt;br /&gt;# for executable files (binary and scripts) chmod 755 hello.sh is better&lt;br /&gt;# chattr changes some attributes of files (somehow...)&lt;br /&gt;# chown changes the owner of the file&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;cls&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;cls&lt;br /&gt;# clears the screen&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;#where is it? cls? clear? clr? home? cl?&lt;br /&gt;#here it is:&lt;br /&gt;reset&lt;br /&gt;# does the whole scrolly bit over, like closing rxvt and reopening it (that part applies more to xwin of course)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;copy&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;copy hello.txt hello.bak&lt;br /&gt;# makes a backup of hello.txt&lt;br /&gt;copy a:\*.txt c:\hello&lt;br /&gt;# copies all files ending in .txt in a:\ to a folder called hello on the c: drive, but does not work unless folder exists&lt;br /&gt;# usually, and used from the console, copy will ask before overwriting an existing file. not usually from a script&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;cp hello.txt hello.bak&lt;br /&gt;# same as dos example&lt;br /&gt;cp /mnt/floppy/*.txt /mnt/home/hello&lt;br /&gt;# assumes floppy and c: drive are at the above mount points. will create folder called hello if it doesn't exist&lt;br /&gt;# cp does not ask before overwriting. using cp -i instead of just cp will force interaction (not overwrite without asking)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;cd (or) chdir&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;a:&lt;br /&gt;cd \&lt;br /&gt;# changes to a drive and folder \&lt;br /&gt;cd ..&lt;br /&gt;# changes to parent folder&lt;br /&gt;cd \hello\there&lt;br /&gt;# changes to hello\there folder from \&lt;br /&gt;cd there&lt;br /&gt;# changes to there from current folder&lt;br /&gt;cd&lt;br /&gt;# displays current folder&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;# virtually the same. in dos, cd/ and cd.. are okay, in linux the space is required: cd / and cd ..&lt;br /&gt;# you have to use cd (instead of chdir)&lt;br /&gt;# cd (nothing else) does not show the current folder in linux. pwd (print working directory) is used instead.&lt;br /&gt;# to change to the "a:" drive in linux (from the gui)&lt;br /&gt;# run mut from xwin (or click the drives icon) and click [scan] on fd0&lt;br /&gt;# click [mount]&lt;br /&gt;# from the console:&lt;br /&gt;cd /mnt/floppy&lt;br /&gt;# when done: click [unmount]&lt;br /&gt;# click [noscan]&lt;br /&gt;# you could also learn how to use mount from the console (sorry, not included in this howto)&lt;br /&gt;# mut is so great, someone should make a console version that uses keys like a b c d e f g h (buttons, not driveletters!)&lt;br /&gt;# (maybe barry or mu or i will make a console version someday? don't know what it entails)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;del (or) delete (or) erase&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples&lt;br /&gt;del *.*&lt;br /&gt;del .&lt;br /&gt;# (either one) deletes all files in a folder&lt;br /&gt;del *.txt&lt;br /&gt;# deletes all files ending in .txt&lt;br /&gt;del hello.txt&lt;br /&gt;# deletes hello.txt&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;# be careful with * wildcards!&lt;br /&gt;# if you are going to use a wildcard, use "ls [wildcards]" instead of "rm [wildcards]" to see what may be deleted...&lt;br /&gt;rm *&lt;br /&gt;# deletes files; if someone randomly tells you to type rm -f * or something like that, kick him. hard...&lt;br /&gt;rm *txt&lt;br /&gt;# deletes files ending in txt&lt;br /&gt;# -r is recursive (recursion in dos and linux are not exactly the same, that's why you don't see more notes on it here)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;dir&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;dir *.txt&lt;br /&gt;# list all txt files&lt;br /&gt;dir *.txt /b /a &gt; list.txt&lt;br /&gt;# list all txt files even if they are hidden. /b says just show filenames... send output to list.txt&lt;br /&gt;dir /w&lt;br /&gt;# show files in a multicolumn layout&lt;br /&gt;dir c:\*at* /a /s&lt;br /&gt;# show all files in all folders in the c drive, if the filename contains "at"&lt;br /&gt;dir /?&lt;br /&gt;# show more info on dir. works on many dos commands&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;ls *.txt&lt;br /&gt;# same as in dos, but if there is a folder called something.txt it will show that folder too, etc.&lt;br /&gt;ls *.txt -1 -a &gt; list.txt&lt;br /&gt;# include "hidden" files that start with . (yeah they are hidden) in one column... send output to list.txt&lt;br /&gt;ls&lt;br /&gt;# this is more like dir /w&lt;br /&gt;ls -l&lt;br /&gt;# that's an l like in "linux" not to be confused with -1 (one) from the other example. this outputs more like dir&lt;br /&gt;ls /*at* -a&lt;br /&gt;# show all files containing "at" in the name, but only in the / folder, and any folders recursed that also include "at"&lt;br /&gt;ls --help&lt;br /&gt;# show more info on ls. works on many linux commands&lt;br /&gt;# here's a really good one, thanks to jcoder24 for it:&lt;br /&gt;find / -depth -name *at*&lt;br /&gt;# this is much closer to dir /s /b in dos, and in xwin try it with: | leafpad &amp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;exit&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;exit&lt;br /&gt;# closes the console in windows&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;# it's the same, but will close the apps opened from the console too.&lt;br /&gt;# the way around this is to append any command with &amp; for instance:&lt;br /&gt;leafpad hello.txt &amp;amp;&lt;br /&gt;# now hit enter a couple times (or wait a minute)&lt;br /&gt;exit&lt;br /&gt;# right. also, if you click [X] on the window, the &amp; is moot... it closes apps even if they were run with &amp;amp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;echo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;echo&lt;br /&gt;# display if "echo" is on or off&lt;br /&gt;echo.&lt;br /&gt;# echo a blank line (useful in scripts to look nice)&lt;br /&gt;echo cd \ &gt; hello.bat&lt;br /&gt;echo dir *.txt &gt;&gt; hello.bat&lt;br /&gt;# this creates a script called hello.bat that changes to the \ folder and shows the .txt files there.&lt;br /&gt;# &gt; writes to a file (overwrite / create new)&lt;br /&gt;# &gt;&gt; apppends to a file (append / create if not existing)&lt;br /&gt;# to run the script, enter:&lt;br /&gt;hello&lt;br /&gt;# you can type hello.bat but the suffix is required in the name&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;echo&lt;br /&gt;# blank line, same as echo. in dos&lt;br /&gt;echo cd / &gt; hello.sh&lt;br /&gt;echo ls *.txt &gt;&gt; hello.sh&lt;br /&gt;chmod 755 hello.sh&lt;br /&gt;# creates the same script as above and makes the script executable&lt;br /&gt;# to run the script, enter:&lt;br /&gt;./hello.sh&lt;br /&gt;# you must type .sh at the end if it's part if the name, but you don't have to name it that way&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;fc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;fc hello.txt hello.bak&lt;br /&gt;# show the differences between the two files, if any&lt;br /&gt;fc /b hello.exe hello2.exe&lt;br /&gt;# do a binary comparison of files (shows differences in hex, if any)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;diff hello.txt hello.bak&lt;br /&gt;# basically the same idea. for binary files, you can try just using diff&lt;br /&gt;# also, you can try this:&lt;br /&gt;md5sum hello&lt;br /&gt;md5sum hello2&lt;br /&gt;&lt;br /&gt;usually when two files are different, the single-line md5sum is different. file integrity checking is often done this way&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;move&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;move *.txt a:\hey&lt;br /&gt;# move all .txt files to a:\hey&lt;br /&gt;move hellofolder hello2folder&lt;br /&gt;# rename a folder&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;mv *.txt /mnt/floppy/hey&lt;br /&gt;# same as above, assumes mountpoint at /mnt/floppy&lt;br /&gt;mv hellofolder hello2folder&lt;br /&gt;# rename a folder&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;md (or) mkdir&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;md hello&lt;br /&gt;# create folder named "hello"&lt;br /&gt;mkdir hello&lt;br /&gt;# same thing&lt;br /&gt;md /mnt/home/hello&lt;br /&gt;# create "hello" folder in /mnt/home&lt;br /&gt;mkdir /mnt/home/hello&lt;br /&gt;# same thing&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;# you have to use mkdir (instead of md)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ren (or) rename&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;ren hello.txt hello.bak&lt;br /&gt;#rename the file to...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;mv hello.txt hello.bak&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;rd (or) rmdir&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;rd thisisafolder&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;rm -r thisisafolder&lt;br /&gt;# dos won't usually let you remove a folder that has files in it&lt;br /&gt;# linux usually will&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;rem&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;rem hey look, this does nothing!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;# this usually does nothing!&lt;br /&gt;# however, the following is used to identify a bash script:&lt;br /&gt;#!/bin/sh&lt;br /&gt;# the following is used to identify a puppybasic script:&lt;br /&gt;#!/usr/bin/wxbasicscript&lt;br /&gt;# you get the idea. technically, it STILL does nothing... but it does, however, change how a script is interpreted&lt;br /&gt;# (or how a file is identified)&lt;br /&gt;# all bash scripts should really start that way you know:&lt;br /&gt;#!/bin/sh&lt;br /&gt;# but my creation of a script using echo without that header still worked&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;start&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;start notepad&lt;br /&gt;start http://pupweb.org&lt;br /&gt;#this is really a windows thing... but a command preceded by "start" sometimes works when it ohterwise would not&lt;br /&gt;start cmd /c dir | more&lt;br /&gt;# opens a new console, runs dir and pipes to more&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;# exec is somewhat, but not exactly, like start. xwin does not need to be running to use it.&lt;br /&gt;# sometimes preceding a command with exec helps in .rc files when you want to run a command&lt;br /&gt;# to open a website, use defaultbrowser:&lt;br /&gt;defaultbrowser http://pupweb.org&lt;br /&gt;# to open a new console:&lt;br /&gt;rxvt &amp;&lt;br /&gt;# to run a command in a new console:&lt;br /&gt;rxvt -e ls | more&lt;br /&gt;# opens a new console, runs dir and pipes to more&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;time&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;time&lt;br /&gt;# shows/sets current time&lt;br /&gt;time 00:00:00&lt;br /&gt;# sets time to midnight&lt;br /&gt;# to do the same with the date:&lt;br /&gt;date&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;date&lt;br /&gt;# shows the time (it also shows the date)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;type&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;type hello.txt&lt;br /&gt;# displays a text file&lt;br /&gt;type hello.txt | more&lt;br /&gt;# displays a text file with more&lt;br /&gt;more hello.txt&lt;br /&gt;# same as the previous example&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;in linux:&lt;/span&gt;&lt;br /&gt;more hello.txt&lt;br /&gt;# same as dos&lt;br /&gt;less hello.txt&lt;br /&gt;# "less is more" Razz less lets you scroll... (caveat, i forget how to make it stop)&lt;br /&gt;more hello.txt | leafpad&lt;br /&gt;# that one is fun, try with ls or find (does not work with mp)&lt;br /&gt;# this seems to work:&lt;br /&gt;more hello.txt | less&lt;br /&gt;# the idea being more useful with things like ls and find since leafpad isnt available when xwin isn't&lt;br /&gt;# if you don't love any of those, try using cat for type:&lt;br /&gt;cat hello.txt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;questions? other tips? ideas? (corrections?) reply!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;notes:&lt;/span&gt;&lt;br /&gt;want to wiki? lobster made a wiki page and wants to know how it can be better formatted: &lt;a href="http://puppylinux.org/wikka/DosCli"&gt;http://puppylinux.org/wikka/DosCli&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;gn2 suggests this alternative bash&lt;-&gt;dos page: &lt;a href="http://www.yolinux.com/TUTORIALS/unix_for_dos_users.html"&gt;http://www.yolinux.com/TUTORIALS/unix_for_dos_users.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;also, there is a really amazing page on this subject at the linux doc project: &lt;a href="http://tldp.org/"&gt;http://tldp.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;KTWI: most of these were tried in puppy 2.11 and most should work in 1.07, nohup is available in puppy 2.12 and later.&lt;br /&gt;&lt;br /&gt;thanks to: lobster, dougal, gn2, "chandlerman", amish&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-8341175174057023603?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/8341175174057023603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=8341175174057023603' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8341175174057023603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/8341175174057023603'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/bash-howto-for-dos-lovers.html' title='bash howto for dos lovers'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465258041713689505.post-2553109156952189289</id><published>2007-01-12T06:00:00.000-08:00</published><updated>2007-01-14T18:52:36.595-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blog'/><category scheme='http://www.blogger.com/atom/ns#' term='post'/><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><title type='text'>howto post to this blog</title><content type='html'>firstly, please note that anything you submit to this blog is Public Domain and can be used and edited by anyone, even in a commercial project (but also in any free project.) this is easier than using for instance, the gnu fdl license, as not all the projects that benefit from this blog use that license. you can still use content from here, in gnu fdl content.&lt;br /&gt;&lt;br /&gt;there are several ways you can post or contribute to this blog:&lt;br /&gt;&lt;br /&gt;use the comment feature:&lt;br /&gt;&lt;br /&gt;1. suggest a change- this is like a wiki, except you don't have to edit wiki code. all suggestions will be taken seriously, but not all suggestions will be followed. compare to wiki where no suggestions are taken seriously, and many changes are reverted. eh... wiki is good, no- great, but only if you're "in."&lt;br /&gt;&lt;br /&gt;unless there is an important reason to remove them, suggestions will be left in place as comments even if they are not used, and they will be removed if they are incorporated into the main post.&lt;br /&gt;&lt;br /&gt;2. comment with a url- please note that spam will be treated as spam, and (due to human imperfection and mistakes that are otherwise regretfully made) sometimes even a good url will be treated as spam :) but do feel Quite Free to post a url. if it is yours, say so and the contents will be added to the blog. otherwise, we will consider writing a blog entry ABOUT the url and its contents.&lt;br /&gt;&lt;br /&gt;3. write a whole entry! we want to add entries to this blog. at this writing, it's unknown (by the author) how long a comment you can write. don't be bashful.&lt;br /&gt;&lt;br /&gt;use murga's forum:&lt;br /&gt;&lt;p&gt;as of this writing, only one post on murga's puppylinux forum contains the string "**docme" - add this to the end of your post on the forum, and your post will be (manually) added here. it's that simple! also, if you add "**docme" to a comment on the forum, about a post you didn't write, it's just like "comment with a url" (above.)  PLEASE DO NOT spam murga's forum with a post that says "docme" and contains nothing else, we're not advocating that sort of clutter.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;two more things to consider:&lt;br /&gt;&lt;/p&gt;1. (in theory) credits go to the contributers of each post- we will do our utmost (which may prove imperfect) to thank everyone involved in each post, at the bottom of each post. "thanks to:" also serves as an "i wrote this" signature:&lt;br /&gt;&lt;br /&gt;thanks to: amish, everyone that participates *&lt;br /&gt;&lt;br /&gt;*an example "thanks to" line.&lt;br /&gt;&lt;p&gt;2. ktwi: (known to work in...) if you know the version of puppy 1.07 / puppy 2.11 / grafpup 104 / muppy 006 etc, include it. many things here will work across many versions, but it's great to&lt;br /&gt;note what version you are writing about :)&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;thanks to: amish, and You!&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-2553109156952189289?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/2553109156952189289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=2553109156952189289' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/2553109156952189289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/2553109156952189289'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/howto-post-to-this-blog.html' title='howto post to this blog'/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465258041713689505.post-3724320015946087421</id><published>2007-01-12T05:17:00.000-08:00</published><updated>2007-01-14T18:50:39.574-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='another'/><category scheme='http://www.blogger.com/atom/ns#' term='documentation'/><title type='text'>another documentation project? :(</title><content type='html'>**another** documentation project? not necessarily, more like another way to contribute to them.&lt;br /&gt;&lt;br /&gt;this blog was setup as an idiot-friendly* :) means of contributing and organizing (and searching for) documentation for puppylinux (and derivatives...)&lt;br /&gt;&lt;br /&gt;* in this case, the term "idiot" is used to mean: "someone that may not be stupid, but can't be bothered with the technical work of maintaining html, wikis, etc. - similar to the line of books."&lt;br /&gt;&lt;br /&gt;all posts may be copied elsewhere, used in your own documentation, and so on. as a result, we must ask you not to post content unless it is your writing- or unless it is already public domain. the exception being url's (web links) to pages on the net, or posts on murga's puppy forum, that you would like to see documented here. you can link to anything, as a request that it be written about.&lt;br /&gt;&lt;br /&gt;of course this is all volunteer work, and, we can't and will not be held responsible for what you do with your machine or anyone else's.&lt;br /&gt;&lt;br /&gt;to add something, or suggest a change, simply use the comment feature. no special formatting is required, but any special formatting will be considered. don't be shy, either- please feel welcome to donate your posts to our cause, and thanks in advance.&lt;br /&gt;&lt;br /&gt;lastly, credits go to the contributers of each post- we will do our utmost (which may prove imperfect) to thank everyone involved in each post, at the bottom of each post, and it is at least recommended that those using this resource do the same.&lt;br /&gt;&lt;br /&gt;also, if posssible, consider the "KTWI" (known to work in) notes... if you know the version of puppy 1.07 / puppy 2.11 / grafpup 104 / muppy 006 etc, include it. many things here will work across many versions, but it's great to note what version you are writing about :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;thanks again, and HTH!&lt;br /&gt;&lt;br /&gt;- amish&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2465258041713689505-3724320015946087421?l=puppydocblognode1.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://puppydocblognode1.blogspot.com/feeds/3724320015946087421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2465258041713689505&amp;postID=3724320015946087421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/3724320015946087421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465258041713689505/posts/default/3724320015946087421'/><link rel='alternate' type='text/html' href='http://puppydocblognode1.blogspot.com/2007/01/another-documentation-project.html' title='another documentation project? :('/><author><name> </name><uri>http://www.blogger.com/profile/13596962497791542358</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>
