Puppy wxBasic

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

Puppy wxBasic

#1 Post by Lobster »

I am working on writing a tutorial for Puppy wxBasic
in (can anyone guess?) Puppys easiest, latest and soon to be IN Puppy language . . .

Here is the about section to introduce you to wxBasic
. . . remember MU (Mark) is already posting on wxBasic AND creating great programs for Puppy in this language. I will be concentrating on the part built into Puppy 1.0.5 (not the release candidates or Alphas - will only be in the full version out 26 /27 Sept)

You will also find an accomplished tutorial program written by Jerry for wxBasic

My program will be much simpler - like its author
:)

/////////////////////////
Puppy wxBasic is based on the work of David Cuny and Mark Ulrich
/////////////////////////

Puppy wxBasic is a small interpreted version of BASIC
(Beginners All-purpose Symbolic Instruction Code)

The Puppy wxBasic programming language, available in Puppy 1.0.5
is based on the easy-to-use syntax of the BASIC language
Puppy wxBasic is simple to learn and understand,
allowing novice programmers to write Puppy applications
with graphical environments

Basic is usually a scripted, interpreted language.
Good implementations such as wxBasic allow a procedural layout
making sections work and then calling them where appropriate

BASIC allows rapid development and learning
because of its familiarity and simple command layout

David Cuny wrote the original wxBasic in C and C++
to be cross compatible with MS Windows
Mark Ulrich compiled the tiny version without the
wxWidgets extension and added some functions
that makes Puppy wxBasic a small optimized system utility

Puppy wxBasic is a simple way of running programs

The full wxBasic can create stand-alone executables
by binding together source code with the interpreter
Executables produced by wxBasic do not require any external
resource file, or installer to run
The executable is distributed alone and can be run
immediately by end users.

wxBasic is a cross-platform BASIC interpreter licensed under the LGPL
While not complying with the ANSI BASIC standard,
wxBasic provides much of the functionality associated
with modern structured BASIC, along with a number of
extentions borrowed from languages such as Python, Lua and Java

At its core, wxBasic is a fairly small language, weighing in
at under 300K (less than 80K when compressed via UPX)
However, wxBasic gains much of its functionality by
using the wxWidgets library, which provides a cross-platform GUI
and non-GUI functionality. The wxWidgets-enabled version of wxBasic
is far more capable, but quite a bit heftier
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

Puppys very own Basic

#2 Post by Lobster »

8)

Be aware kennel members that this tutorial will only run in the yet to be released Puppy 1.0.5
UNLESS you have and place the required files in Puppy 1.0.4
- which I have done (so there!) meaning I am in effect writing programs in Puppys very own Basic

I am learning and using Puppy wxBasic at the same time

Sweet!

When Puppy 1.0.5 is released I will remove this section - quite possibly

I have tried to make the info understandable even to those who have never programmed
- hey now is your chance . . .




This will show you how to run the famous

"Hello World" program in Puppy 1.0.5

This is the program:

============= Program is between this line

#!/usr/bin/wxbasicscript
// My first ever Program in Puppy wxBasic
include "/usr/lib/wxbasicscript/basefunctions.inc"

xmessage ( "Hello Puppy World" )

=============== Program is between this line


/////////
////// About the program
/////////

* The program is a piece of text
* The program can be opened and saved in Leafpad or Beaver (any PLAIN text editor)
* Lines that begin with // at the start are REMS or remarks
they are ignored by the program
* This section "#!/usr/bin/wxbasicscript" will be familiar to script writers
It identifies the program as wxbasicscript AND show the location of the interpreter
which makes your program run
* This:
include "/usr/lib/wxbasicscript/basefunctions.inc"
is used in languages such as C to include extra functions
for the wxbasicscript to use

* This:
xmessage ( "Hello Puppy World" )
is the same as PRINT "Hello World" in older Basics
xmessage is a widget or function that draws an xmessage box on the screen
and places the words "Hello Puppy World" on your desktop

/////////
////// Setting up the Program
/////////

* Open Leafpad
* Cut and past the program into a file

#!/usr/bin/wxbasicscript
// My first ever Program in Puppy wxBasic
include "/usr/lib/wxbasicscript/basefunctions.inc"

xmessage ( "Hello Puppy World" )


/////////
////// Running the Program
/////////

* The program can be saved in any directory leading off
or created in root or usr
* Call the program
Helloworld.wxbs
* Change the program into an executible file by right click on it
Select File 'Helloworld.wxbs' / Permissions
Select "a+x (Make executable/searchable)" - the default
Click yes
* The program is now executible (runnable)
* Try right clicking on it
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

Just as I was doing this two tutorials came out - tee hee :?

The PuppyBasic page on the wiki needs some work
http://www.goosee.com/puppy/wikka/WxBasic

Anyone up for it - go for it :D
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

kethd
Posts: 451
Joined: Thu 20 Oct 2005, 12:54
Location: Boston MA USA

How to use BASIC in Puppy

#4 Post by kethd »


User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#5 Post by Lobster »

Nice job kethd :)

After MU posted this (wxbasicscript = PuppyBasic)
http://noforum.de/wxBasicscript-documen ... /index.htm

I seemed to have been occupied elsewhere . . . :roll:
. . .
Anyway turned the tutorial code into this:
http://www.murga.org/%7Epuppy/viewtopic ... 6449#26449
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

BASIC written in javascript

#6 Post by Lobster »

Here is a BASIC written in javascript that runs from your browser . . .
http://navahogunleg.net/blog/?page_id=56

- just a bit of fun


MU has been using wxbasicscript (not the above - sorry for any confusion below) for his drag 'n drop

wxBasicScript (Puppy Basic) anyone any plans to use it? What do you intend?
Last edited by Lobster on Fri 23 Dec 2005, 20:34, edited 1 time in total.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

Re: BASIC written in javascript

#7 Post by edoc »

Lobster wrote:Here is a BASIC written in javascript that runs from your browser . . .
http://navahogunleg.net/blog/?page_id=56

- just a bit of fun

MU has been using it for his drag 'n drop
wxBasicScript (Puppy Basic) anyone any plans to use it? What do you intend?
Y'all have my head spinning!

I start reading about wxBasic (I am already confused because I am expecting something related to weather as wx is a common abbreviation for weather) and that C is used in creating it.

Then as a read down I see the text quoted above and am really confused ...
Basic written in JavaScript intended for use in a Browser. Whew!

Can you clarify why JavaScript needs wxBasic and why what is being created cannot be done efficiently in HTML?

So many coding systems so little time!

;-) doc
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

Post Reply