This command tells PuppyBasic to take the program directly from the keyboard:
# puppybasic /dev/tty

Now you can enter your program:
print "Hello World"

On the next line, just enter CTRL-D to finish entering the program. Then the program will run immediately!

STORE A PROGRAM

That is actually a good way to try some simple commands, to see quickly how they work. But you will soon want to use an editor for your programs.

Change to a temporary directory:
# cd tmp

Make a program file:
# leafpad hellow

In the editor, enter the file and save and exit:
' My first program
print "Hello World"
print 2+2
print "Goodbye"
end

Now you can run the program:
# puppybasic hellow

Program development tip:
For quickly making changes and testing them, use the up-arrow key on the command line, to access your previous commands to use the editor or run the program.
For some reason, it does not seem to work to leave the editor open while you try out program changes. But if you open the editor in another one of your four "workspaces", then you can leave it open -- just Save and switch to the console in the other workspace to try it out.

If you have not used BASIC since the 1980's, the line numbers and REM statements seem to be gone, so you will have to brush up on this version.

Use the desktop FIND command to search for files containing wxbs in their names, to see complex examples in Puppy.

You can learn more at:
http://puppylinux.org/wikka/PuppyBasic
http://puppylinux.org/wikka/WxBasic
http://noforum.de/wxBasicscript-documentation/wxbasic/frameset.htm
http://noforum.de/wxBasicscript-documentation/wxbasicscript/index.htm

http://www.murga.org/%7Epuppy/viewtopic.php?t=2349
http://www.murga.org/%7Epuppy/viewtopic.php?t=2457
http://www.murga.org/%7Epuppy/viewtopic.php?t=2339
(There is supposed to be an automatic system of executing BASIC programs in Puppy, based on naming files with .wxbs extensions, but it does not seem to work for simple command line text programs.)

print "Hello World"
print 2+2
print "Goodbye and thanks for all the fish"

end

when given changed permissions with rox
(make it excutible)
will run the message BUT the other parts require a command line interface
so run console (right click and open xterm where your script file is)
then type ./myscript (where myscript is the name of your executible text script)

Now you should get a prog in a window and the results of 2+2 etc in the rxvt console window . . .

Hope that works for you _________________Puppy WIKILast edited by Lobster on Sat 03 Dec 2005, 00:49; edited 1 time in total

Hmmm... This is not so easy!
I have gotten your example to work. Sort of...
It seems like PuppyLinux does not associate file types with execute modules? The file extensions are mostly arbitrary/meaningless, just to help the humans keep track of things?
It seems like making a file "executable" just means the system is willing to process it as a shell script, if it is text? (How does it distinguish from real binary code?) But for some reason, the current directory is not in the default path, so you need to use ./ to force a reference to the current directory...
The leading #! on the first line tells it where to go for the real executable, to process the text code lines that follow?
The include line just includes text from another file as though it appeared at that point?
The xmessage code makes a window, and requires the included library code to be defined. (After the window closes, sometimes getting "focus" back in the text window is a problem.)

This seems like it may be a reasonably simple way to do complicated (GUI) things -- but so far it seems like a pretty complicated way to do simple things. In terms of simple command line text mode BASIC programs, it seems like there is no advantage to the wxbs naming convention or the #! invocation. (In fact, in the tests I just did, the #! seemed to over-ride my manual invocation of puppybasic from the command line, and prevent me from being able to pass flags like -trace.)

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum