## Search found 394 matches

Tue Mar 04, 2008 10:51 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Cannot post code!
Replies: 4
Views: 8925
Use the option to "Disable HTML in this post". Usually fixes code posting problems.
Thu Feb 21, 2008 6:15 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: sizeof()
Replies: 12
Views: 16945
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.``````
Thu Feb 07, 2008 5:43 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: binair to bits
Replies: 20
Views: 29591
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, ...
Tue Feb 05, 2008 11:56 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: binair to bits
Replies: 20
Views: 29591
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.
Mon Feb 04, 2008 9:40 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: binair to bits
Replies: 20
Views: 29591
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 '...
Sun Jan 27, 2008 10:24 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Fastest way to get Keyboard presses
Replies: 21
Views: 35146
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 pssys progr...
Sat Jan 26, 2008 9:55 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Fastest way to get Keyboard presses
Replies: 21
Views: 35146
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
Thu Jan 24, 2008 9:31 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Fastest way to get Keyboard presses
Replies: 21
Views: 35146
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.
Thu Jan 24, 2008 7:52 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Fastest way to get Keyboard presses
Replies: 21
Views: 35146
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``````
Thu Jan 17, 2008 4:51 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Im A newb.
Replies: 8
Views: 15243
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...
Wed Jan 16, 2008 8:00 pm
Forum: General Discussion
Topic: What programming languages have a bit as variable type?
Replies: 9
Views: 16352
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.
Wed Jan 16, 2008 7:56 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Um, credit card genorator problem...
Replies: 23
Views: 35323
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 he thought ...
Sun Jan 13, 2008 11:32 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Um, credit card genorator problem...
Replies: 23
Views: 35323
I probably could if you gave me more information, I'm always up for a challenge.
Sat Jan 12, 2008 6:06 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Um, credit card genorator problem...
Replies: 23
Views: 35323

### 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 ...
Sat Jan 12, 2008 2:36 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Um, credit card genorator problem...
Replies: 23
Views: 35323
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 ...
Tue Oct 02, 2007 10:41 pm
Forum: General Discussion
Topic: I need to get a hold of...
Replies: 2
Views: 7939
Yeah, I got a response, I guess I was just being impacient

Thanks anyway.
Mon Oct 01, 2007 1:02 pm
Forum: General Discussion
Topic: I need to get a hold of...
Replies: 2
Views: 7939

### 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.
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: 28874
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\$ = "1" THEN SearchP IF kp\$ = "2" THEN...
Mon Sep 24, 2007 3:37 pm
Forum: General Discussion