Search found 394 matches
- Tue Mar 04, 2008 10:51 pm
- Forum: QBASIC and QB64 Questions & Answers
- Topic: Cannot post code!
- Replies: 4
- Views: 7336
- Thu Feb 21, 2008 6:15 pm
- Forum: QBASIC and QB64 Questions & Answers
- Topic: sizeof()
- Replies: 12
- Views: 13892
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: 23910
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: 23910
If you're only dealing with 4 bits, then a simple 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.
Code: Select all
YourValue% XOR 16
- Mon Feb 04, 2008 9:40 pm
- Forum: QBASIC and QB64 Questions & Answers
- Topic: binair to bits
- Replies: 20
- Views: 23910
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: 28437
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: 28437
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
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: 28437
- Thu Jan 24, 2008 7:52 pm
- Forum: QBASIC and QB64 Questions & Answers
- Topic: Fastest way to get Keyboard presses
- Replies: 21
- Views: 28437
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: 12339
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: 13615
- Wed Jan 16, 2008 7:56 pm
- Forum: QBASIC and QB64 Questions & Answers
- Topic: Um, credit card genorator problem...
- Replies: 23
- Views: 28713
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: 28713
- Sat Jan 12, 2008 6:06 pm
- Forum: QBASIC and QB64 Questions & Answers
- Topic: Um, credit card genorator problem...
- Replies: 23
- Views: 28713
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: 28713
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: 6583
- Mon Oct 01, 2007 1:02 pm
- Forum: General Discussion
- Topic: I need to get a hold of...
- Replies: 2
- Views: 6583
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.
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: 23771
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
- Topic: is Qb dead?
- Replies: 21
- Views: 33562
-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...
- 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: 23771
"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 of the menu SUB AddP CLS COLOR 10, 0 INPUT "Name:", name...