Search found 98 matches

by Zim
Mon Mar 20, 2006 12:44 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Getting Key Codes
Replies: 6
Views: 8234

keyboard scan codes

I usually use the printed reference manual, however a quick "Yahoo" search gave this as the first "hit":

http://www.barcodeman.com/altek/mule/scandoc.php
by Zim
Fri Mar 17, 2006 12:51 pm
Forum: General Discussion
Topic: QB array help; TWO PROGRAMS
Replies: 4
Views: 7388

If (that's a big IF) you know how many numbers (elements) are in the array, then:

Code: Select all

sum=0
for i=1 to n
  print i, array(i)
  sum=sum+array(i)
next i

print "Total is"sum
will essentially do what you want, that is, to print each of the values in the array, and add them up.
by Zim
Fri Mar 17, 2006 12:44 pm
Forum: General Discussion
Topic: Need a little Qbasic help ( MID$ )
Replies: 4
Views: 5859

Re: Need a little Qbasic help ( MID$ )

...you need to make sure that the user enters first, middle or initial, and last name, otherwise the FULLNAME is invalid and the program won't work right. Also, do you want to program for the case when the user puts more than one space in between the name fields? To do this program correctly will i...
by Zim
Fri Mar 10, 2006 11:35 am
Forum: General Discussion
Topic: idea for random number generator...
Replies: 5
Views: 7752

I think there's a little more to it than that, maybe not. I'd like to see the algorithm. Maybe it's easier with rational numbers, but with irrational numbers like pi and sqr(2), it takes real computing power to get further and further out. That's why it's such a big deal to compute millions of digit...
by Zim
Wed Mar 08, 2006 12:51 pm
Forum: General Discussion
Topic: idea for random number generator...
Replies: 5
Views: 7752

So the random sequence is the digits of the root? Ok. that's good, but as you need more and more digits it will become harder and harder to compute them. Might get kinda slow...
by Zim
Thu Mar 02, 2006 12:39 pm
Forum: News and Announcements
Topic: helped need from new library!
Replies: 6
Views: 12069

This sounds great! I once wrote a couple of subs (for qb3). They were called ifexist() and fopen(). The purpose was to determine if a file (with user specified name) existed as specified, and to actually open it if possible, but WITHOUT returning an error. Normally one would compile the program with...
by Zim
Mon Feb 27, 2006 12:53 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Point of Intersection
Replies: 8
Views: 9385

This is not a trivial problem! This is the sort of thing I did for 20 years with my programs. Surveyors run into this sort of thing all the time. I don't have time to check your math, but if it works for most cases it's probably right. It's easier to find an intersection for two lines, than for two ...
by Zim
Mon Feb 27, 2006 12:45 pm
Forum: General Discussion
Topic: which sci-fi crew are you in?
Replies: 15
Views: 19264

The fact that all the percentages don't add up to 100% bothers you:

Disagree Agree
1...2...3...4....5
by Zim
Wed Feb 22, 2006 12:50 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: A few questions...
Replies: 4
Views: 5350

randomize

Randomize re-seeds the random number generator (RNG) but it doesn't "set" the seed. For example: randomize 555 print rnd randomize 555 print rnd would be expected to return the same number, but it doesn't. Here's the output from QB 3 .9563706 .1887001 You'll get other numbers from QB 4, but they'll ...
by Zim
Wed Feb 22, 2006 12:39 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: windows linux compatability
Replies: 7
Views: 8072

FreeBasic

Code:

randomize 462 (I put a space in it)
print rnd

Here's the output:

0.778656005859375
by Zim
Fri Feb 10, 2006 12:47 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: need help please
Replies: 6
Views: 5836

QuickPak

I can't really remember the version number. I do remember that it was right after QB v 4.0 came out. Ethan was trying to convince me to switch from v3 to v4. I should have taken his advice. I'm still using 3 because I like it alot. Version 4 has many advantages, but at the time I didn't feel like co...
by Zim
Tue Feb 07, 2006 12:52 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: QB45-XP-LCD screen
Replies: 4
Views: 7304

I had a problem with printing to line 25 in Windows (in a Window). I fixed it by setting a specific font (10x25 or something) insteading of letting Windows default to "Auto" font. I wonder if that would help in this situation?
by Zim
Tue Feb 07, 2006 12:46 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: need help please
Replies: 6
Views: 5836

Ethan Winer

I called Cresent Software once with a question about QuickPak Pro. Ethan answered the phone! He was nice; very knowledgable and fun to talk to.
by Zim
Fri Feb 03, 2006 11:08 am
Forum: QBASIC and QB64 Questions & Answers
Topic: help on limiting keys
Replies: 29
Views: 31032

Even better!
by Zim
Fri Feb 03, 2006 11:03 am
Forum: General Discussion
Topic: Q Basic program for the 12 days of Christmas
Replies: 3
Views: 6727

A start

Code: Select all

input n
for i=n to 1 step -1
  print i
next i
given a number, will print a list of numbers from that point counting down to 1.

For your program, you have to decide what you want done for each day, and code that in, in place of the "print i".

That's a start. Was this due before Christmas??
by Zim
Thu Feb 02, 2006 12:35 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: help on limiting keys
Replies: 29
Views: 31032

Right! But you have to be absolutely sure that (at least) ONE of the cases is true, else the program will bomb. I usually do something like this: Input "Option (1) or (2) ", k Select Case k case 1 : print "You said ONE" case 2 : print "You said TWO" case else 'do nothing End Select Adding that one l...
by Zim
Thu Feb 02, 2006 12:28 pm
Forum: General Discussion
Topic: DOS/QB Chess
Replies: 5
Views: 6757

AI

Aritficial Intelligence. (Did I spell that right?) Sorry, I should have spelled it out in my original post. I had been looking for freeware chess programs. Many descriptions included "AI" or "two player", meaning "person against computer" or "person against person" with the program acting as a chess...
by Zim
Wed Feb 01, 2006 11:25 am
Forum: QBASIC and QB64 Questions & Answers
Topic: help on limiting keys
Replies: 29
Views: 31032

GoTo's can be dangerous, but subs and functions should be ok... no?
by Zim
Fri Jan 27, 2006 12:52 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: help on limiting keys
Replies: 29
Views: 31032

(PaulUnknown's "nevermine" notwithstanding...) Just remember, if you're going to use SELECT CASE after a keyboard input, you'd better have a CASE ELSE at the end of your case list, or you'll have to have a CASE for every key on the keyboard! Otherwise, after the first keystroke you're not checking f...
by Zim
Tue Jan 24, 2006 12:28 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: help on limiting keys
Replies: 29
Views: 31032

Sorry...

Sorry, Awakened, but that won't work. Inkey$ scans the keyboard one time when it's executed. The first keystroke will pop the program out of the first loop. The case structure will execute based upon the SECOND keystroke which will, in THIS case typically be blank or the null string. EDIT: Yup, that...