Search found 151 matches

by Mac
Tue Dec 18, 2007 7:57 am
Forum: QBASIC and QB64 Questions & Answers
Topic: A good problem for you experts
Replies: 13
Views: 9476

Re: I dunno Mac

your example is not the best either, but neither was mine looking back. True. Let's clarify further These two always give the same result: ?????IF (INP(889) AND 128) THEN ?????IF INP(889) AND 128 THEN so you retract the statement that the outer parentheses are useful in that case and agree that the...
by Mac
Mon Dec 17, 2007 9:11 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: A good problem for you experts
Replies: 13
Views: 9476

Re: parentheses

coma8coma1 wrote:does this apply to QuickBASIC, or to GW BASIC only
Suggestion: take something which you wonder works on the same.

1) Try in on QuickBASIC
2) Try it on GW BASIC

I use neither. I use QBasic. My guess is they are the same.

Mac
by Mac
Mon Dec 17, 2007 9:07 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Scrolling
Replies: 13
Views: 8527

Explain?????????????

Can you please explain the code? ??? What's there to explain ??? I'll do my best: Stuff$ = (Whatever you are searching for) You define some variable, I suggested Stuff$ but you could use any name. You put "$" to mean it is a text variable. You set it to whatever you are searching for. You brought u...
by Mac
Mon Dec 17, 2007 3:46 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Scrolling
Replies: 13
Views: 8527

[quote="Lee"]Im using the Command prompt command "Find" and then it prints the stuff out like nuts and it goes off the top of the screen. How do I scroll back up? After the FIND command, add "> MyFile.txt" (If your operating system doesn't work, write your whole FIND command out to a BAT file and sh...
by Mac
Mon Dec 17, 2007 3:28 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: A good problem for you experts
Replies: 13
Views: 9476

IF (INP(889) AND 128) THEN PRINT "Valid data" While I agree that one should always use parentheses in order to avoid bugs caused by one's faulty application of the order of operations, I don't follow your example. IF 321 AND 128 THEN PRINT 1 ELSE PRINT 2 IF (321) AND (128) THEN PRINT 1 ELSE PRINT 2...
by Mac
Sun Dec 16, 2007 8:42 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: IF instruction doesn't work?
Replies: 9
Views: 5946

extra print

Did you put in the extra PRINT I suggested? If so, please post the results of your run By the way 150 DIM Q(N), Q1(N), Q2(N), Q9(N), D(N), V(N), CJ(N), CL(N), D0(N), CLO(N) AS DOUBLE will only dimension CLO(N) AS DOUBLE The rest get the default SINGLE. If you really need DOUBLE, you need separate DI...
by Mac
Sat Dec 15, 2007 5:00 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: IF instruction doesn't work?
Replies: 9
Views: 5946

Re: IF instruction doesn't work?

I removed the line 1280 and the application doesn't make the calculations If you remove 1280 then you have to also remove 1282 and 1284. Are you trying to run that program in GWBASIC? If so, you cannot terminate a statement with THEN. You have to code like Nodtveidt said: Get rid of 1282 and 1284 a...
by Mac
Sat Dec 15, 2007 4:15 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: IF instruction doesn't work?
Replies: 9
Views: 5946

It will help make the code look a hell of a lot cleaner, easier to debug, and not so 1975. :P Yep. If the OP is interested, here is a program that will remove all line numbers except lables, which it converts say 1020 to L1020. http://www.network54.com/Forum/178387/message/1197752905 Mac P.S. Utili...
by Mac
Sat Dec 15, 2007 1:08 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Scrolling
Replies: 13
Views: 8527

Re: Scrolling

Ok, when i use the command prompt to print stuff in qbasic, how would i beable to scroll through it? use VIEW? I dunno. I cant even guess on how to put the results in an array :? I am unable to determine what you want. Could you please explain further. What is the problem? I'll make a problem up fo...
by Mac
Sat Dec 15, 2007 12:59 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: IF instruction doesn't work?
Replies: 9
Views: 5946

Get rid of the line numbers Eliminating the line numbers will not help solve this problem. Running the program below, I got these results: 1 : Q(l/s),L(m),h(M) ? 1, 5.6, 5.5 2 : Q(l/s),L(m),h(M) ? 1, 5.6, 5.6 3 : Q(l/s),L(m),h(M) ? 1, 5.6, 5.7 3 : Q(l/s),L(m),h(M) ? 1, 1.0, 1.0 I am calculating. Wa...
by Mac
Sat Dec 15, 2007 9:36 am
Forum: QBASIC and QB64 Questions & Answers
Topic: IF instruction doesn't work?
Replies: 9
Views: 5946

Debugging Suggestion

Insert line after 1270 and run again. Report what you see.

Mac

Code: Select all

1260 FOR I = 1 TO NTR 
1270 PRINT "Tube "; I; ": Q(l/s),L(m),h(M) "; : INPUT Q2(I), CL(I), CLO(I) 
print "Debug:  ";CL(I),CLO(I)
1280 IF (CLO(I) > CL(I)) THEN 
by Mac
Thu Dec 13, 2007 12:25 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Command prompt problem (SHELL)
Replies: 9
Views: 8009

Lee wrote:This is messed up
Hmm, could you try

Code: Select all

cmd /c start
instead of just Start?

Mac
by Mac
Wed Dec 12, 2007 8:34 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Command prompt problem (SHELL)
Replies: 9
Views: 8009

More info please

Ok, heres my code now... Im stuck with the command prompt part where is opens a file. Fix your code so it looks like this: ======================================================= INPUT "Search for Part of/ file:", sactname$ cmd$ = "FIND /I " + CHR$(34) + sactname$ + CHR$(34) + " " + data$ PRINT "Wi...
by Mac
Thu Dec 06, 2007 5:39 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Trying to get a Battleship Program ASAP
Replies: 29
Views: 18178

I sure would like to see the solution

From what I can determine, it is a two-player game. How is it played. My guess: Get Player 1 password. Get Player 2 password. do Demand Player 1 password Allow Player 1 to play Clear the screen Demand Player 2 password Allow Player 2 to play Clear the screen loop This appears to be a tough assignmen...
by Mac
Wed Dec 05, 2007 12:28 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Trying to get a Battleship Program ASAP
Replies: 29
Views: 18178

Graphics

We seem to be stuck on advanced graphics. What are the specs of this game? My thought would be to use no SCREEN command but simply use PRINT "sss" to be an ordinary ship and "BBB" to be a battle ship. And use LOCATE to place them, and an Array to keep track of where they are. Are you supposed to fir...
by Mac
Tue Dec 04, 2007 9:08 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Cut binary file
Replies: 5
Views: 6232

Shortening a file

Yes, as I already said "If the whole file fits in memory, you could read it in, close, open for output, close, and the write it out again." But if the file won't fit, you have to create a new file. If your one file is so big that there is no room for two on your disk, you are doomed. So I suggested ...
by Mac
Tue Dec 04, 2007 4:29 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Cut binary file
Replies: 5
Views: 6232

Re: Cut binary file

If I want to shorten a binary file, how can I do that? Good question. You would think this would be easy, but I don't know any way. If the whole file fits in memory, you could read it in, close, open for output, close, and the write it out again. Why bother, though, to shorten a file? What is your ...
by Mac
Sun Dec 02, 2007 9:30 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: What's the largest possible double number?
Replies: 8
Views: 6677

Re: What's the largest possible double number?

"d+308" means "times 10 raised to the 308th power." Right. The letter "d" is used to designate you need double precision to hold this number. It otherwise the same as "e", meaning "exponent". To directly answer your question: 1797693134862315000000000000000000000000000000000000000000000000000000000...
by Mac
Sun Dec 02, 2007 8:33 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: What's the largest possible double number?
Replies: 8
Views: 6677

Re: What's the largest possible double number?

Mentat wrote:Please don't use e.
How about "d"?

K# DOUBLE
double-precision 64-bit floating-point
Sixteen place accuracy, Max = 1.797693134862315D+308
by Mac
Tue Nov 27, 2007 8:39 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Lists in QBASIC
Replies: 3
Views: 3269

Re: Lists in QBASIC

Or would I have to hard code the damn thing. You have to hard code it. There are no objects in QBasic as there are in VB. Even MSGBOX must be hard coded. We are using "hard code" to mean "code it the hard way", I guess. "Hard code" usually refers to using internal constants rather than variable sup...