how when you find a BASIC Compiler and that need to be compiled with a BASIC Compiler and that need to be compiled with a BASIC Compiler and that need to be compiled with a BASIC Compiler and that need to be compiled with a BASIC Compiler and that need to be compiled with a BASIC Compiler......
const MAGIC_NUMBER = 17
print "Guess the number"
print "I'm thinking of a number, can you guess what it is?"
do
input "Your guess: ", guess%
if guess% > MAGIC_NUMBER then print "Nope,"; guess%; "is too high."
if guess% < MAGIC_NUMBER then print "Nope,"; guess%; "is too low."
loop while guess% <> MAGIC_NUMBER
print "Yes, you got it!"
DIM Value% 'numeric value the user supplies
INPUT "Enter a number between 1 and 100 >", Value%
IF Value% < 1 THEN
PRINT "That number is less than one!"
ELSEIF Value% > 100 THEN
PRINT "That number is greater than one hundred!"
ELSE
PRINT "Thank you for helping us help you help us all."
END IF
Name it: QB60_More. Hey your fault, you asked for a pun.
Pete
WOW man ...!
That is great ...i like it !
Asked for a pun, not a punishment...
In reference to GOTO, please forgive my forwardness, but why? I thought 'that' bane of spaghetti-basic had been 'put down' years ago... Just the thought of a loop performing its function and told part way through to leave the loop and probably never come back... is almost 'cringeworthy' (probably not a real word - but you get what I mean). Let's not talk about how we noobs (ok me) find it difficult to translate goto's into 'basics' that no longer use line numbers... I was just getting used to using subroutines and functions and easy to follow structured listings...
But, that's just my opinion, for what it's worth... lol
Anyway, besides what I think, I hope that you can implement both line numbers 'and' labels without too many headaches...
I need more coffee... I think I'm babbling again...
Luke. You stated, "(only line numbers for now - no labels)"... But, aren't line numbers, labels? If not what is the difference? Just curiousThe difference is in recognition. Consider this code:
10 PRINT X$
lbl: PRINT Y$
It's really easy to recognise 10 as a line number - we just say if we're at the start of the line and see an integer, it's a line number.type t
a as long
b$
end type
v = 4
dim a(3, v / 2) as t
a(2, 1).a = 4
a(2, 1).b = "hello"
a(3, 2) = a(2, 1)
print a(3, 2).a; a(3, 2).b
Yep, that's a dynamically-sized multi-dimensional array of a user-defined type containing variable length strings.I've got a rather large collection of interpreters written in basic languages ...
- Dav
Is this something you are willing to make available?
I really like the test.bas supplied with 65. I've been using it for some of my own unit testing, and it works great!
To get it working on Windows, I only had to make a few simple changes:
I suppose I could, Ed. I think I have one by you (I recognize the name). Didn't you make the Toy Interpreter? Or something named like that...Yep, I'm guilty of that one.
- Dav
sub s(a, option b, option c)
print "a = "; a;
if option(b) then print "b = "; b;
if option(c) then print "c = "; c;
print
end sub
s 1
s 2, 3
s 2, 3, 4
s 2, , 4
Sub s1
s2
End Sub
s1
Sub s2
Print "Hi"
End Sub