Search found 394 matches

by Patz QuickBASIC Creations
Tue Mar 04, 2008 10:51 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Cannot post code!
Replies: 4
Views: 13057

Use the option to "Disable HTML in this post". Usually fixes code posting problems.
by Patz QuickBASIC Creations
Thu Feb 21, 2008 6:15 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: sizeof()
Replies: 12
Views: 24222

LEN() also shows the number of bytes needed by the variable.

Code: Select all

LEN(Int%) = 2
LEN(Lng&) = 4
LEN(Sgl!) = 4
LEN(Dbl#) = 8
LEN(Strng$) = Number of characters in the variable, each weighing in at 1 byte each.
by Patz QuickBASIC Creations
Thu Feb 07, 2008 5:43 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: binair to bits
Replies: 20
Views: 50774

Not entirely related, but... http://www.petesqbsite.com/forum/viewtopic.php?t=1830 Also, a more simple but less universal (than the one in the other post I linked to) code to determine the bits of a number... 'Inputs: YourNum% - The number to turn into binary. 'Outputs: Bin$ - The number in binary, ...
by Patz QuickBASIC Creations
Tue Feb 05, 2008 11:56 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: binair to bits
Replies: 20
Views: 50774

If you're only dealing with 4 bits, then a simple

Code: Select all

YourValue% XOR 16
should give you what you're looking for. That's saying if you pull out the 4 bits you needed into the YourValue%, that is.
by Patz QuickBASIC Creations
Mon Feb 04, 2008 9:40 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: binair to bits
Replies: 20
Views: 50774

Burger's way pretty much shows it in a nutshell. Pretty much, once you have the variable loaded, you can use one of the bitwise -operators to manipulate it. Here's another example. Say that Bit 0 controls whether a certain action is done or not. You can toggle it many different ways. OurValue% = 1 '...
by Patz QuickBASIC Creations
Sun Jan 27, 2008 10:24 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Fastest way to get Keyboard presses
Replies: 21
Views: 70318

I don't recommend using INP, as if you make the program correctly, INKEY$ should be enough for most purposes. To use backspace, you have to print a blank space (CHR$(32) or " "), and then locate back to that space. That's the most simple way to do it. Edit: To do something similar to the p...
by Patz QuickBASIC Creations
Sat Jan 26, 2008 9:55 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Fastest way to get Keyboard presses
Replies: 21
Views: 70318

I made this a long time ago... Hopefully you can get it to work without too much work. I've commented it so you can see exactly what's going on and exactly how to use it... Basic knowledge of LOCATE a major plus.

http://pastebin.ca/874102
by Patz QuickBASIC Creations
Thu Jan 24, 2008 9:31 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Fastest way to get Keyboard presses
Replies: 21
Views: 70318

First off, you can't use characters in CASE, ie CASE 4B, unless they are hexadecimal, in which case you need to tell it so. And, you don't need to have the INP in there, just use the one I posted, it works fine.
by Patz QuickBASIC Creations
Thu Jan 24, 2008 7:52 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Fastest way to get Keyboard presses
Replies: 21
Views: 70318

Though not entirely better, you could do:

Code: Select all

CLS 
DO

DO 
k$ = INKEY$ 
LOOP UNTIL K$ <> ""

SELECT CASE k$

CASE "q" 
PLAY "mbE" 

CASE "w" 
PLAY "mbF" 

CASE "e" 
PLAY "mbB" 

END SELECT
LOOP
by Patz QuickBASIC Creations
Thu Jan 17, 2008 4:51 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Im A newb.
Replies: 8
Views: 22018

Well, first off, welcome to the QuickBASIC community! If you ever have anything to ask, we're usually pretty friendly here and get things sorted out. As for your question, I don't understand exactly what you mean, but doing string1$ + string2$ makes the text of string2$ be appended to the end of str...
by Patz QuickBASIC Creations
Wed Jan 16, 2008 8:00 pm
Forum: General Discussion
Topic: What programming languages have a bit as variable type?
Replies: 9
Views: 21877

In BASIC a boolean/bit type aren't necessary/logical. Smart manipulation of the logical operators (AND, OR, XOR, NOT, IMP) should be enough to get you where you need to be.
by Patz QuickBASIC Creations
Wed Jan 16, 2008 7:56 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Um, credit card genorator problem...
Replies: 23
Views: 59397

It doesn't matter, the credit card numbers generated by that code are probably not valid, and not functional without the expiration date, PIN number, and CCV number. Though, my code does pretty much generate "valid" numbers, though they won't get far. Pete would have deleted it by now if h...
by Patz QuickBASIC Creations
Sun Jan 13, 2008 11:32 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Um, credit card genorator problem...
Replies: 23
Views: 59397

I probably could if you gave me more information, I'm always up for a challenge.
by Patz QuickBASIC Creations
Sat Jan 12, 2008 6:06 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Um, credit card genorator problem...
Replies: 23
Views: 59397

Re: How it works

Interesting way to check the numbers over 10 when multipied by 2: LuhnCheck% = LuhnCheck% + 9 * (LuhnCheck% >= 10) Subtracting the 9 wasn't my idea, but using the logical operator in there was. Coming from TI-BASIC makes you see tons of small optimizations you can do to the program. Also, to tweak ...
by Patz QuickBASIC Creations
Sat Jan 12, 2008 2:36 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Um, credit card genorator problem...
Replies: 23
Views: 59397

I've checked this against some sites on the internet, all validating my code against the Luhn method, so this code does what you need it to do. However, you might want to tweak it to make sure that you're not going out of industry boundaries. More info here: http://www.merriampark.com/anatomycc.htm ...
by Patz QuickBASIC Creations
Tue Oct 02, 2007 10:41 pm
Forum: General Discussion
Topic: I need to get a hold of...
Replies: 2
Views: 12182

Yeah, I got a response, I guess I was just being impacient :P

Thanks anyway. :)
by Patz QuickBASIC Creations
Mon Oct 01, 2007 1:02 pm
Forum: General Discussion
Topic: I need to get a hold of...
Replies: 2
Views: 12182

I need to get a hold of...

Plasma.

Has anyone seen him lately? Is he usually on IRC or some instant messneger?



Thanks for the help.
by Patz QuickBASIC Creations
Tue Sep 25, 2007 8:00 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Help with searching for words (for a data base)
Replies: 20
Views: 50135

OK, seeing moneo's comment, I saw that stupid mistake. *head meets desk* Try this... 'Revised, untested. CLS DO COLOR 10, 0 LOCATE 5, 15 PRINT "DATABASE" LOCATE 22, 5 PRINT "(1) SEARCH" LOCATE 22, 30 PRINT "(2) ADD" DO kp$ = INKEY$ LOOP UNTIL kp$ <> INKEY$ IF kp$ = &quo...
by Patz QuickBASIC Creations
Mon Sep 24, 2007 3:37 pm
Forum: General Discussion
Topic: is Qb dead?
Replies: 21
Views: 59922

-lang qb is something I dont know. What is it? It's a compile time option for FreeBASIC to make it so your program that was in QB has a much better chance of compiling, but you also have most (if not all) the old restrictions that QB had. In my opinion, this is one of the best things I have seen fo...
by Patz QuickBASIC Creations
Sun Sep 23, 2007 7:28 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Help with searching for words (for a data base)
Replies: 20
Views: 50135

"Revised, untested. CLS DO COLOR 10, 0 LOCATE 5, 15 PRINT "DATABASE" LOCATE 22, 5 PRINT "(1) SEARCH" LOCATE 22, 30 PRINT "(2) ADD" DO kp$ = INKEY$ LOOP UNTIL kp$ <> INKEY$ IF kp$ = "1" THEN SearchP IF kp$ = "2" THEN AddP LOOP 'This is the end o...