"Roger Johansson" <no-(E-Mail Removed)> wrote in message
news:c57lsn$2prrp0$(E-Mail Removed)...
> Vic Drastik wrote:
>
> > Note that XBasic is open-source for Windows and Linux and has been since
> > 1999. That means you can not only look at and recompile the source
yourself,
> > you can add features, and even write your own version. This has already
been
> > done - a version of XBasic optimised for Windows already exists - look
here
> > http://perso.wanadoo.fr/xblite/ This has features which the original XB
does
> > not - much smaller, allows inline assembly language, extra commands,
> > embedded Tcl/Tk, etc., etc.
>
> Please tell me where to find hundreds or even more examples of Xbasic
> code, I could not find much when I looked for it.
I don't know which language RapidQ is written in, but XBasic is written in
XBasic, so the largest set of examples is the XBasic source itself. Here is
an example from the XB standard system library Xst -
FUNCTION XstDisplayConsole()
XstGetConsoleGrid(@grid)
IF grid <= 0 THEN RETURN
XuiSendMessage(grid, #DisplayWindow, 0, 0, 0, 0, 0, 0)
END FUNCTION
'
FUNCTION XstHideConsole()
XstGetConsoleGrid(@grid)
IF grid <= 0 THEN RETURN
XuiSendMessage(grid, #HideWindow, 0, 0, 0, 0, 0, 0)
END FUNCTION
'
This shows how readable XBasic is - first we call a system library function
to get the number of the console, which is just a display window, then check
if the console is valid. If not, do nothing and return. If valid, either
display or hide the console by passing a message. Simple. Thousands more
examples of XB functions available there. Also, see the demo directory that
comes with XBasic. Also see the XBasic mailing list on Yahoogroups and the
associated files stored there. Also see the examples on the xblite site
above. Also see the references on
www.xbasic.org You cannot have looked
very hard if you failed to find these.
> Why is the programming environment and all example programs in XBasis in
> a middle-dark grey color, are there no other colors in XBasic?
> Why cannot the XBasic editor use the normal windows colors which the
> user of the computer has chosen?
You must be one of these people who chooses their car based on paint
colours, rather than reliability, safety, price or other factors. RapidQ is
certainly better-looking than XBasic, so I can see why you prefer it. This
question did come up a few years ago, and I think the answer was that XBasic
was written 17 years ago, and this is how programs looked then and no-one
can now be bothered spending the time to update the look, but it could be
done if necessary. Also, many XB users don't even use the IDE that comes
with XB - they configure their favourite editor for XBasic and use that as
their IDE. Or some even use XB with a commandline interface and don't bother
with GUI at all.
>
> I am not asking to create an argument, I would love to use XBasic if
> somebody could tell me how to make it usable and could tell me where to
> find good code examples for it.
XBasic is an ugly duckling, but it looks more like a swan the more you use
it. We recently had a quine competition and here is the winning program ( a
quine is a program that reproduces itself - that is, its output is an exact
copy of its source code). The following program is even better - a
self-checking quine. It not only is a quine, but it checks itself for
quineness, and only prints itself out if it confirms that it is a quine.
DECLARE FUNCTION Q()
FUNCTION Q() STRING
a="DECLARE FUNCTION Q() STRINGEND FUNCTIONquine0.x"
b="q=CHR$(34):n=CHR$(10):x=CHR$('=')+q:w=q+n"
c="A=CHR$('a')+x+a+w:B=CHR$('b')+x+b+w:C=CHR$('c')+x+c+w

=CHR$('d')+x+d+w:E
=CHR$('e')+x+e+w"
d="y=MID$(a,1,20)+n+MID$(a,9,19)+n+A+B+C+D+E+b+n+c+n+d+n+e+n+MID$(a,28,12)+n
"
e="i&=OPEN(MID$(a,40),0):s=NULL$(LOF(i&)):READ [i&],s:CLOSE(i&):IF y==s THEN
PRINT y"
q=CHR$(34):n=CHR$(10):x=CHR$('=')+q:w=q+n
A=CHR$('a')+x+a+w:B=CHR$('b')+x+b+w:C=CHR$('c')+x+c+w

=CHR$('d')+x+d+w:E=CH
R$('e')+x+e+w
y=MID$(a,1,20)+n+MID$(a,9,19)+n+A+B+C+D+E+b+n+c+n+d+n+e+n+MID$(a,28,12)+n
i&=OPEN(MID$(a,40),0):s=NULL$(LOF(i&)):READ [i&],s:CLOSE(i&):IF y==s THEN
PRINT y
END FUNCTION
I would be interested to see a quine written in RapidQ.
>
> Are there some good XBasic web sites? Url:s?
> Roger J.
See
www.xbasic.org or google xbasic.
Vic