*BOOM!by (Login PhyloGenesis)R * |
*You see the fireworks show too?by (no login) |
KABOOM! (More...)by (Login PhyloGenesis)R Hey ComputerGhost go to the Chatroom and say "PhyloG". The PhyloGenesis |
*Has the "Cone of Silence" gone balistic? lol - Re "Boom"by Pete (no login) |
*What?! KAAAABBOOOOOOMMMM!!!!!by (Login PhyloGenesis)R * |
*Pete and ComputerGhost Connect in the QBasic.com Chatroomby (Login PhyloGenesis)R * |
*I see... some 3.141592653589793... dood. But not textby (no login) |
*What are you talking about?by (Login PhyloGenesis)R * |
I really feel this thread wastes space and should be deleted. WHAT DO YOU THINK?by (Premier Login iorr5t)Forum Owner I logged in as forum owner in order to delete this thread, but then realized that not everyone might agree that such threads should disappear. I am curious what other forum members think about it. Or maybe someone could explain what on earth a post that simply says *BOOM! means. Possibly I am "out of it". Mac |
I wondered about that to, then I figured it out (I think)...by Pete (Login Pete_J_L)BTW - Yes, I think it can be deleted, certainly my post within the thread can. Remember when you posted in the FAQ to announce on the forum when you want to go to "chat?" Well, I think "Boom" was somehow one of those announcements. (I don't believe that was your suggestion, was it?) Anyway, it took a couple of threads and an invite for me to figure that out and go there. I was so amazed that thing actually worked, that I never asked about the leading post! So, you can delete my part of the thread, and thanks for asking btw. My guess is PhyloG and ComputerGhost will concur. (And probably give the OK to delete there part of the thread as well - lol) Just growing pains I suspect. We'll all get it down eventually. (BTW - That's a saying my wife uses. She says I'm a growing pain every day.) Pete This post will (may) self-destruct with the others. |
* LOL - OK, the thread is gone if nobody else objectsby (Premier Login iorr5t)Forum Owner |
*ByeBye thread!by (no login) |
Helpby (no login)In need a qbasic program that call open a data file, look at a field a numbers and add a mod10 check digit to it. |
Max, Please check the homework FAQ. When you have some code started...by Chief of Control (no login)...post it to the forum (See how to post in the FAQ as well.) Ask for specific help on what it is that you cannot seem to get working. Others here and myself will be glad to help then. Currently from your post, I can only make assumptions like, do you want a random access file? (There are also binary and sequential files that can be created and accessed in QB.) Also, the "mod" question is very unclear to me. Please check the FAQ and post some code for more help. |
qb hex errorsby the unknown qb programmer (no login)try running the following program: CLS PRINT "Evidence supporting QB is good at math:" PRINT "1 + 1 ="; 1 + 1 PRINT "Evidence supporting QB stinks at math:" FOR i = 1 TO 4 READ z x = x + VAL("&H" + LTRIM$(STR$(z))) PRINT "&H" + LTRIM$(STR$(z)); " + "; NEXT i LOCATE , POS(0) - 2 PRINT "= &H"; HEX$(x); "!?!?!?!?" PRINT "OK, let's try that again, but hardcoded this time:" PRINT "&H1110011 + &H2220200 + &H404440 + &H8808 = &H"; HEX$(&H1110011 + &H2220200 + &H404440 + &H8808); "..." PRINT "Well, at least a little better..." PRINT "Let's see the correct answer:" PRINT "&H1110011 + &H2220200 + &H404440 + &H8808 = &H373CE59" PRINT "(checked on my TI-36X Solar to be correct)" DATA 1110011, 2220200, 404440, 8808 i get the output: Evidence supporting QB is good at math: 1 + 1 = 2 Evidence supporting QB stinks at math: &H1110011 + &H2220200 + &H404440 + &H8808 = &H372CE58!?!?!?!? OK, let's try that again, but hardcoded this time: &H1110011 + &H2220200 + &H404440 + &H8808 = &H372CE59... Well, at least a little better... Let's see the correct answer: &H1110011 + &H2220200 + &H404440 + &H8808 = &H373CE59 (checked on my TI-36X Solar to be correct) i realize that sometimes qb has a tendancy to have its math off by a 1/1000000th, but &H10000?! does anyone else get a different output? |
*Interesting, too bad I don't have a clue.by (Login PhyloGenesis)R * |
wow, you almost had me thinking qb has a bug..by (no login)it doesn't :-) This should clear it up: PRINT &H8808 PRINT &H8808& output: -30712 34824 Since &H8808 fits in an INTEGER, it'll be treated as an INTEGER. &H8808 has the highmost bit, the sign bit, as a 1, so the number is negative. The & on the end will force the number to be a LONG. For longs, hexadecimal values equal to larger than &H80000000 would be negative. Unfortunately QB doesn't have unsigned (only positive) data types. Oh, and the off by one error with the for loop is probably due to floating-point approximation. Make x a LONG. DIM x AS LONG CLS FOR i = 1 TO 4 READ z x = x + VAL("&H" + LTRIM$(STR$(z) + "&")) PRINT "&H" + LTRIM$(STR$(z)); " + "; NEXT i LOCATE , POS(0) - 2 PRINT "= &H"; HEX$(x) PRINT "&H1110011 + &H2220200 + &H404440 + &H8808 = &H"; PRINT HEX$(&H1110011 + &H2220200 + &H404440 + &H8808&) PRINT "&H1110011 + &H2220200 + &H404440 + &H8808 = &H373CE59" DATA 1110011, 2220200, 404440, 8808 -/\lipha |
*thanks!by the unknown qb programmer (no login) |
hey alipha, while you're here...by the unknown qb programmer (Login unknownqbprogrammer)i tried running some code from your screen 12 peek/poke tutorial, and now screen 12 won't do anything when i do print, pset, line, anything. do you have any ideas on how to fix it? |
*Reboot.by Pete (Login Pete_J_L) |
*didn't helpby the unknown qb prorgrammer (no login) |
eh? dunno...by (no login)SCREEN 12 LINE (100, 0)-(200, 100), 3 DEF SEG = &HA000 OUT &H3C4, 2 OUT &H3C5, 6 POKE 8012, 16 LINE (0, 0)-(100, 100), 2 Both lines get drawn fine.. dunno what to say. QB's built-in commands should be good about resetting the port settings after you mess with them. -/\lipha |
tried your program...by the unknown qb programmer (no login)saw a blank screen. pete, my monitor could not be broken, but even if it was, i got a new one recently. it might have something to do with the monitor - when using screen 9, the screen looks "translated" so the center is in the top right corner of the screen. |
No, not broken...by Pete (no login)I posted that those two PEEK/POKE codes were the only ones I knew of that had a warning that if they were used, they could physically damage some monitors. Since you did not use them, right? this could not have happened. My point was that all changes from using all of the other PEEK and POKE commands sould be canceled on reboot. However, I also saw in the post by Alipha something about the "OUT" command. Frankly, I have never used OUT/INP commands, so I cannot comment on the effect OUT may have had. It still seems very strange. Pete |
it is possible to ruin a monitor or video card with improper OUT/INP.by (no login)an old/crappy one that is. a decent quality monitor or video card should be able to take any kind of abuse you throw at it. um.. unless you mistyped some numbers or something to access a wrong port, I don't see how any of the OUT statements would damage your monitor or video card. Also, I would think other video modes would be damaged if that happened. -/\lipha |
*no, only screen 9 looks kind of odd (other than 12)by the unknown qb programmer (Login unknownqbprogrammer) |
More help needed on this post ...by Pete (Login Pete_J_L)I'm surprised. I have heard that peek and poke 116 and 117 can physically damage a monitor but other than that, to my understanding of PEEK and POKE, rebooting the system is supposed to cancel out any changes made from the use of these commands. I do not know what platform you are working on. NT does not handle PEEK and POKE commands well. 2000 and XP seem OK with them. Maybe it will come to me once I pry the idea out of my brain that reboot did not work. I would suggest emailing Alipha if he does not respond today or if another forum member does not figure it out first. Sorry reboot was not the answer, Pete |
De Jef and I successfully used the chatroom!by (Premier Login iorr5t)Forum Owner I wondered if it worked. Anyway, here are instructions that I have added to the **FAQ** http://www.network54.com/Forum/message?forumid=171757&messageid=1089304625 Solitaire, if you figure it out, De Jef has something to discuss with you. Mac |
*No time now. Gotta run.by Solitaire (Login Solitaire1)S |
*The only problem I have ever had with the chat is no one is there.by (Login PhyloGenesis)R * |
* I am in the Chatroomby (Premier Login iorr5t)Forum Owner If you can't figure it out, try this: http://www.network54.com/Forum/message?forumid=171757&messageid=1089304625 Mac |
Poblem with end!!!???by (no login)I'm using QuickBasic v4.5,when i made program and compile it to make an stand alone .EXE file,it works!!!(of course)But when it came to the end of program it's close the window program without the end message.Meaby something is missing me,but does anybody know how to make my programs to stay on the end message. thank's |
There is no "end message" in compiled versions.by (Login Mac36)That is just a feature of the interactive QBasic. I hate it and alwasy terminate my QBasic programs with SYSTEM rather than END so that if the user starts the program via "QBasic /run xxx" then at the end it closes the window and exits, just like EXE files always do. However, you may want the user see a final screen before exit. To accomplish this: LOCATE 25, 1: PRINT "Press spacebar to exit"; DO: LOOP WHILE INKEY$ <> " " CLS SYSTEM Mac |
*Or any key " WHILE INKEY$ = "": WEND "by (Login PhyloGenesis)R * |
*Or any key " WHILE INKEY$ = "": WEND "by (Login PhyloGenesis)R * |
I would wager in the 7*10^6 years this forum has been around, that question has never...by Pete (no login)been asked before! And yet, it's not a bad one. I never thought of it that way. To me, I compile every project I want to keep as an exe and I'm happy to have it vanish when it is terminated. This post really caught me off guard. Mac already provided a suitable solution, so I do not have anything in addition to offer. BTW, if you read my post Mac, Pleeeeeeeeeese do not take the "wager" comment as some sort of a challenge. (Mac will usually go to the ends of the earth to check on stuff like this it seems.) Besides, you've already had a hard day working on all those SPAMectomies! Hopefully, that is over. Pete |
same here i never even noticed qb doing that...by Shadowwolf (Login DarkShadowWolf)taking away the press any key to end , but in the end not having it better right i mean do you really want the user to have to press a key to end the program i mean there not much of a opation with that you A) press it and end the program or B) don't press and leave there ontil you want to press it and final end the program it not like you can cancel out what ever you need to end the program in the first place. so the press any key to end is a meaningless fucation qb add's. that is unless somone can give me a good reason for it. |
Well, shadowwolf, I suppose...by (Login Mac36)Let's say you want to compute 2+2 You bring up QBasic and enter PRINT 2 + 2 Then you say RUN If there were no such prompt, you would still simply be staring at your program. You would have to press F4 to see the answer. So they must have thought it convenient. But they did not think of that when termining an EXE. I have often preached use SYSTEM instead of END, but have been caught losing the final printout and had to use F4. I am used to that, but a newbie might wonder where the output went. Mac |
hmm never though about that ...by ShadowWolf (Login DarkShadowWolf)wow i can't belive i never though about that and it is a good reason to have it , i guss im so use to creating more complex programs that little fucation of qb is pointless |
LOLby (Login Mac36)Actually, I have read mosts posts for the last several years and, true, nobody has asked. Yep, it is a slight pain zapping SPAM. I have to login as iorr5t. Then I login in as Mac36 to get rid of special privs so I don't accidentally do something like delete the forum. (fear) Mac |
I have seen that question beforeby (Login PhyloGenesis)R and I have only been here for about 2.5 years so I guess Mac wouldn't have to look too far. Although to me it seems like that is a common question (when I first read it, I thought "Geez, why do people ask the SAME questions SO often?!"), I suppose it isn't as I only recall one occurence of it, ever. The PhyloGenesis --------------------------------------------- The name's Genesis, PhyloGenesis --------------------------------------------- Snook's First Law of ("Game" but I don't think that matters) Programming: "For each programmer, there exists an equal and opposite programmer who can't stand reading the first programmer's code." |
Well, Pete reminded me not to take that as a challengeby (Login Mac36)I remember people asking how to prompt for user permission to proceed. Yes, that is often asked. And the answer is appropriate to this user. But this is the first time someone tied that question to program termination of an EXE who, prior to compilation, was happy with the IDE message. But I'm going to somehow resist going through all posts to verify that. LOL Mac |
*Not the first time, I have seen that question before.by (Login PhyloGenesis)R * |
Challenge: Find it.by (Login Mac36)Remember, the question must explicitly say that the problem appeared when an EXE was produced, otherwise everything ran fine. That is the question we are talking about. Not the question of "How do I pause the program" or anything remotely like that. It must reference awe and surprise that a feature they were enjoying while using the IDE suddenly disappeared when they produced an EXE. The question you must find: some equivalent of this: "I'm using QuickBasic v4.5,when i made program and compile it to make an stand alone .EXE file,it works!!!(of course)But when it came to the end of program it's close the window program without the end message.Meaby something is missing me,but does anybody know how to make my programs to stay on the end message." Or, in native English: Why is it that the "Press any key to continue" message that always appears at the end of my runs suddenly disappears when I generate an EXE?" I challenge you to find that question. Mac |
*Oh, and one more thing. You cannot post it today and find it tomorrow! (lol)by Pete (Login Pete_J_L) |
Use INPUT to pause the screen.by Solitaire (Login Solitaire1)S INPUT "Press Enter to end program: ", E$ |
Yep. That's cleaner.by (Login Mac36)At better use LINE INPUT so if the user enters a,b,c it doesn't give bogus error messages. (You know how I insist on defending against crazy users) Mac |
I call that idiot-user-proof (or stupid-user-proof)by (Login PhyloGenesis)R and protecting against invalid paramters I call idiot-caller-proof (or again, stupid-caller-proof). PhyloGenesis |
lol - We're close on this one. I always call it: "stupid-proof"by Pete (no login)When I first started programming, it really used to bug me how much extra work had to go into that. I still do not like wasting my time on it for forum examples, although to some extent I generally do. The thing that amazes me is the preponderance of homework that is assigned to students that does not require them to "stupid-proof" even the input! I never had a computer class, so I do not know just how prevalent this practice of not teaching such a fundamental part of programming actually is. After all, if you can't "stupid-proof" a program, the best you can hope to achieve in life is an upper level programming position at Microsoft. (lol) Pete |
*Or a master IT architect position at the phone companyby Kewbie (no login)* |
Icarus has found you...by MSN Hacker (no login):::VIRUS REPORT::: VIRUS 'NETSKY.D' HAS JUST INFECTED SECTOR 3133 OF DRIVE C:\ WINDOWS WILL NOW LONGER WORK (GUESS YOU'LL HAVE TO USE MS-DOS FROM NOW ON...HOW ABOUT A LITTLE QBASIC PROGRAMMING?) IF YOU HAVE A MAC OR LINUX, THEN YOUR HARD DRIVE WILL STILL BE INFECTED. WE ARE SORRY FOR THE INCONVIENIENCE. ALL TRACES OF WINDOWS MUST BE DESTROYED! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! DESTROY! THANK YOU FOR YOUR TIME. MSN HACKERS |
Re: Icarus has found you...by (no login)msn hackers shall die for daedalus is here |
The Dog Ate my Husband...by James Bond (no login)HELP ME! :¬D |
yo whazzupby (no login)yo james where are you |
I'm right here you unintellectual person!by I HATE HANDCOCK (no login)Was that a good insult or what? SPAM SPAM SPAM SPAM SPAM |
james fletcherby cheese grater (no login)suck my (insert word here using q basic programming) |
Number format in QBby Funkiller (no login)Here's my code :- CLS Count = 0 PRINT "The Equation :" PRINT " Q = A/n*R^(2/3)*S^(1/2)" PRINT "Enter the following parameters :" INPUT "1) Q = ", Q INPUT "2) B = ", B INPUT "3) S = ", S INPUT "4) n = ", n LET D = 1 ' assume first value of D = 1 GOSUB CalQ DO IF Qc > Q THEN D = D - D / 1.1 ELSE D = D + D / 1.1 GOSUB CalQ Count = Count + 1 LOOP UNTIL Qc / Q = 1! PRINT "The result :" PRINT "D = "; D PRINT "A = "; A PRINT "Q with calculated D = "; Qc PRINT "Number of iteratio = "; Count SYSTEM CalQ: A = B * D P = B + 2 * D R = A / P Qc = A / n * R ^ (2 / 3) * S ^ (1 / 2) RETURN I intended to calculate the value of D with the known variables of Q,B,S and n. THe nearer Qc to Q is better. However, Qc will never get to Q, cause i've run it for quite a several times, what i got is the program keep running ...... So, my question is, say Q = 1.556, how should i write the code to stop the looking for D if Qc = 1.567 (say) ? I hope you understand what i meant. How can i limit my number decimal place to be 2 ? Say Q = 1.445 will be exactly 1.445 but not 1.44489867399887 (say) ?? What's the different between SINGLE, LONg and DOUBLE? Thanks |
Number searchby (Login _JT_)you are trying to make the program to stop looking for D if Qc is near to Q Lets say that Q = 1.556 Now the programs running and it finds that Qc = 1.567 What you need to do is something like this: Qs = Qc - Q 'Return the difference IF ABS(Qs) < 0.01 THEN STOP If the difference is less than .01 then stop looking ALSO if you wish to round a number down you can do it like this: (it will round it to 3 decimal places) R# = 1.44489867399887 R# = (CINT(R# * 1000)) / 1000 You ask: What's the different between SINGLE, LONG and DOUBLE Well long is the odd one out - It is a LONG INTEGER (-2147483648 to 2147483648) SINGLE is just a floating point number such as 1.322133, and a double is the same as single but with more precicion and a wider range (1.79769313486231D+308 to 4.940656458412465D-324 ) |
Cheap Viagra, just $3 look here!by (no login)Wow this site offers Viagra at 70% cheaper, I was paying $17, now i pay just $3. They also have big selection of generic drugs for very cheap prices http://stop4rx.com/?dragonx |
*Alec must have got confused and thought we were a VB.NET forum. lolby Pete (no login) |
Viagra Advertisement ?? Is that allowed in this forum ?by Funkiller (no login) |
*It is allowed by Network54, but not by Macby JT (Login _JT_) |
*JT is correct. Enjoy my lol 'cause by tomorrow this post will vanish!by Pete (no login) |
Discussion - ASCII Extended character set....by Pete (no login)Would anyone like to share some information on the forum about why the extended ASCII character set has so little support other than the ability to write these characters to the screen? For instance, I find it interesting that new printers are being made that specifically do not support the use of these characters. Also, products like Notepad, Wordpad, and Word never show them correctly. About the only way to view a file that contains these symbols, is to use a MS-DOS Editor or the QB IDE. I always thought the ability to make frames and boxes, etc. for charting, forms, and the like, was well served by the extended character set. What has replaced it? HTML? Graphics? I'm curious as to how the more modern printing methods work to replace the use of these characters. I may be upgrading from my "Daisy Wheel" printer that Earthborn kids me about soon. Any comments? Pete |
becauseby (no login)it's been replaced by Unicode, a 16-bit character set which obviously has a lot wider range and flexibility with international fonts. |
Hey Neuro, good to hear from you. Question...by Pete (no login)Now I can Google that and see what I find. I have actually heard about it somewhere, but I cannot recall what it was in reference to. One additional question, if your check this reply. How do you access and use the Unicode characters? Can it be done at all with QB or does it require a Windows compatible language? Thanks, Pete |
Unicode in DOSby GreenMan (no login)http://jeff.tk/doschar/ |
Re: Discussion - ASCII Extended character set....by (no login)You can write your own characters in screen modes other than 0. There are programs to do this or simply use draw for example. As far as other printers. If you use a HP compatible laser or inkjet with pcl 5 or less, you can use Esc 10U chr$(27)+"(10U)" to use the PC-8 character set that has the box drawing characters in it. You can then use chr$(196) for example to print the equivilent of - and chr$(205) for the equivilent of = etc. Just a suggestion. |
I've been thinking about thatby (Login _JT_)I guess the new printers nowadays don't have the ASCII characterset programmed into their rom 'cause nobody uses it these days. When i try to print from dos, windows spools it but it goes no further. Its like that my drivers doesn't even accept that data at all - the job just stits in the spooler. The problems might be just driver bases, and a driver could be written to change the ASCII data so it can be used by the printer driver.
|
Not exactly trueby (no login)Of course they use the ascii character set. The windows printing system, however, uses a different system, not a different character set. most is built on what PB calls asciiz strings, basically strings ending in chr$(0). there's a lot more to it than that.. but it's meant to be device independent. In other words with the windows system of printing you can print to any printer that is set up with a valid driver for the OS. The driver will handle the necessary "conversion" to what the printer specifically needs. If you can set the "Dos Capture" for the printer, then you should be able to print. NEVER NEVER get a windows only printer. Severly limits you. And there are other operating systems besides windows. (and MS-DOS). |
_I don't have a printerby (no login)"Also, products like Notepad, Wordpad, and Word never show them correctly." nope, i have seen that notepad (and maybe the others) can show correctly the Ascii codes from 32 to 255 when you use the fonts Terminal or Letter Gothic Line, but to write the grapchic characters (the extended characters) the keys to be used are different, see them in the Charset Map of Windows to paste the grapchic characters they appear as unicode but if the text file to open it is already made with the extended Ascii characters they are shown correctly i don't got a printer so i can't tell you if they can be printed correctly "How do you access and use the Unicode characters?" there is a program for QBasic here http://jeff.tk/doschar/index.html |
To JT re: The indenter programby (Login Mac36)This program http://www.network54.com/Forum/message?forumid=178387&messageid=1088759493 has a bug. (Or at least my copy does) Try the following code. Note Sections 1 and 3 indent properly. Section 2 goofs. Something about END IF, I guess. Indent = 0: IndentSize = 4 'Change to suit your liking (All I did was change 4 to 2) (I later changed 4 to 10 and got worse results) (I have to go out now, but my guess is you have hard-coded 4 somewhere) Mac ' Section 1 FOR x = 1 TO 10 FOR i = 1 TO 10 IF x=y THEN PRINT "Yep" NEXT i NEXT x ' Section 2 FOR x = 1 TO 10 FOR i = 1 TO 10 IF x=y THEN PRINT "Yep" END IF NEXT i NEXT x ' Section 3 FOR x = 1 TO 10 FOR i = 1 TO 10 IF x=y THEN PRINT "Yep" NEXT i NEXT x
|
Whats the problemby (Login _JT_)I get: ' Section 1 FOR x = 1 TO 10 FOR i = 1 TO 10 IF x=y THEN PRINT "Yep" NEXT i NEXT x ' Section 2 FOR x = 1 TO 10 FOR i = 1 TO 10 IF x=y THEN PRINT "Yep" END IF NEXT i NEXT x ' Section 3 FOR x = 1 TO 10 FOR i = 1 TO 10 IF x=y THEN PRINT "Yep" NEXT i NEXT x Is END IF supposed to be at the same level as PRINT? Wait. i just chaged something that MIGHT help if you are using an IndentSize ofther than 4. NEXT x |
I also just finished this.by (Login _JT_)this is a JavaScript version of my Indentor program which i need to be tested for bugs to be kept up to Macs high standard. Also it changes the spaces to chr(0160). Since it is in html, you will need to save it as a htm file. I spent the last 7 hours learning javascript whilst making it, and it is now 5:08am in aus so i am going to sleep. <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> <TITLE>JT's Multiple Space Fixer</TITLE> <SCRIPT LANGUAGE="JavaScript"> function testResults (form) { var inText = TEXTAREA1.value+"\015\015"; var outText="",i,j,k,l, maxspaces=0, curspaces=0,cline; var Indent=0,CurIndent=0,newOut="",f=0,g=0,cline2=""; var cline3="",indentSize=4; indentSize=parseInt(input1.value); inText=trim(inText); outText=inText; if(inText.length==0) { alert("Nothing to do!"); return; } i=0; cline=""; TEXTAREA1.value=""; do { j=outText.charAt(i); if(!(j=='\015')) { cline=cline+j; } else { i=i+1; g=0; f=0; cline3=trim(cline); cline=cline.toUpperCase(); for(k=0;k<cline.length;k++) { if(cline.charAt(k)=='\"') { f = !f; } if((cline.charAt(k)=='\'')&&(f==0)) { g=1; } else { if(g==0) cline2=cline2+cline.charAt(k); } } cline2=trim(cline2); cline2=cline2+" "; CurIndent=Indent; if(cline2.substring(0,4)=="FOR ") { CurIndent=Indent; Indent=Indent+indentSize; } if(cline2.substring(0,3)=="DO ") { CurIndent=Indent; Indent=Indent+indentSize; } if(cline2.substring(0,5)=="NEXT ") { CurIndent=Indent-indentSize; Indent=Indent-indentSize; } if(cline2.substring(0,6)=="WHILE ") { CurIndent=Indent; Indent=Indent-indentSize; } if(cline2.substring(0,5)=="WEND ") { CurIndent=Indent-indentSize; Indent=Indent-indentSize; } if(cline2.substring(0,7)=="END IF ") { CurIndent=Indent-indentSize; Indent=Indent-indentSize; } if(cline2.substring(0,5)=="LOOP ") { CurIndent=Indent-indentSize; Indent=Indent-indentSize; } if(cline2.substring(0,5)=="ELSE ") { CurIndent=Indent-indentSize; } if(cline2.substring(0,12)=="SELECT CASE ") { CurIndent=Indent; Indent=Indent+indentSize; } if(cline2.substring(0,11)=="END SELECT ") { CurIndent=Indent-indentSize; Indent=Indent-indentSize; } if(cline2.substring(0,7)=="ELSEIF ") { CurIndent=Indent-indentSize; } if((cline2.substring(0,3)=="IF ")&&(cline2.substring(cline2.length-5,cline2.length)=="THEN ")) { CurIndent=Indent; Indent=Indent+indentSize; } if(Indent<0) Indent=0; newOut=newOut+space(CurIndent)+cline3+"\015"; cline2=""; cline=""; } i++; } while(i<inText.length); outText=""; inText=newOut; for(i=0;i<inText.length;i++) { j=inText.charAt(i); if(j==' ') { outText=outText+'\240'; curspaces++; if(curspaces>maxspaces) maxspaces=curspaces; } else { curspaces=0; outText=outText+j; } } TEXTAREA1.value=outText; } function trim(s) { while (s.substring(0,1) == ' ') { s = s.substring(1,s.length); } while (s.substring(s.length-1,s.length) == ' ') { s = s.substring(0,s.length-1); } return s; } function space(j) { var s=""; for(i=1;i<=j;i++) s=s+" "; return s; } </SCRIPT> </HEAD> <BODY> <P><STRONG><U>JT's Multiple Space Fixer and Auto Indentor </U> </STRONG></P> <P><TEXTAREA id=TEXTAREA1 style="LEFT: 9px; WIDTH: 600px; TOP: 16px; HEIGHT: 193px" name=TEXTAREA1 rows=9 cols=35>Replace this text for text thats Multiple Spaces are to be fixed for use in the QBasic Forum</TEXTAREA> </P> <P align=left><INPUT id=button1 style="LEFT: 360px; WIDTH: 79px; TOP: 160px; HEIGHT: 24px" type=button value=Fix name=button1 onClick="testResults(this.form)" size=56> Indent Size: <INPUT style="WIDTH: 38px; HEIGHT: 22px" size=4 value=4 name=input1></P> <P align=right> </P> </BODY> </HTML>
|
I guess you found the bug.by (Login Mac36)Yes, one place you hardcoded "4" instead of IndentSize. So when I chose 2, which is my usual indentation, it didn't work. I fixed my version. Mac |
Libraries of QB 7.1by Lionel (no login)Where may I find information relative to the content of QLB Libraries used with QB 7.1 like: FONTBEFR FINANCER MATBEFR CHRTBEFR Thanks |
_in a complete downloadby _Mensliber_ (no login)in the web there are many sites to download the QB7.1 but not all of them are complete if the download has two or three megabytes possibly it is not complete, search a download of four or five megabytes here is one of 5.2O Mbs http://www.billymiller.web1000.com/download/qb71.zip inside you will see the text file Packing.Lst describing the function of every file, that is what you need |
QB 7.1 Librariesby Lionel (no login)Thanks for your help Lionel |
More Help PLEASE!!!!!!!! =( pretty please?by Ryan (no login)Ok guys...I have been workin on this for about 4 hours...I have made progress BUT!! I HAVE to sleep It is now 3:00 in the moring thursday =( ...and if you guys could please tell me what's wrong with my Address program....it is supposed to search for the area or Zip code within a certain range...and all it does is print them all......PLEASE I BEG BEG BEG BEG (Im on my knees) of you to help me...... thanks, And now I present to you the ALMIGHTY CODE!!!!!! ~REM Assignment: 1.10 REM Programmer: Ryan REM Date:03/30/04 ' DIM name$(1 TO 30), address$(1 TO 30), city$(1 TO 30), state$(1 TO 30), zip(1 TO 30), areacode(1 TO 30), phone$(1 TO 30), dob$(1 TO 30) ' howe$ = "continue" DO WHILE (howe$ = "continue") CLS LOCATE 2, 15 PRINT "Menu" LOCATE 4, 1 PRINT "1. Sort Names Alphabetically in Ascending Order" PRINT "2. Sort Names Alphabetically in Descending Order" PRINT "3. Sort Phone Numbers in Ascending Order" PRINT "4. Sort Birthdays in Ascending Order" PRINT "5. Search for a Specific Name" PRINT "6. Search for Zip Codes Within a Specific Range" PRINT "7. Search for Phone Numbers by Area Code" PRINT "8. Quit Program" INPUT "Please enter a number from 1 - 8: ", choice ' SELECT CASE choice CASE 1 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL NameAscend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 2 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL NameDescend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 3 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PhoneAscend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 4 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL BirthdayAscend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 5 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL SearchName(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 6 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL SearchZip(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 7 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL SearchArea(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 8 LET howe$ = "Stop" BEEP CLS LOCATE 10, 25 CALL PressAnyKey CASE ELSE PRINT "You entered a wrong number, try again." END SELECT LOOP ' REM Data Statements DATA "Jordan, Bill","5042 Sundance Lane","Tallahassee","FL",32309, 850,"668-9839","04/27/1951" DATA "Vanenberg, Eric","6045 Peavey Lane", "Alanta", "GA",45807, 582,"298-2452","09/24/1970" DATA "Malais, Chris","3824 Dean Street","New York","NY",34990, 434,"875-2004","06/07/1987" DATA "Garcia, Ricky","2648 Brian More Road", "Tulsa", "OK",74745, 500,"214-6264","04/20/1979" DATA "Corkin, James","1432 Stand Avenue", "Pheniox", "AZ",46599, 808,"548-3356","05/25/1972 DATA "Harisson, Paul","1653 Almond Lane","Bentonville", "AR",15246, 254,"987-3547",09/23/1984" DATA "McCartney, George","4997 Penny Lane", "Harris","MI",34651, 234,"567-8910","03/12/1965" DATA "Clame, Joe", "1313 Elm Street","Dallas", "TX",46957, 542,"578-5151","06/071957" DATA "Clark, Sam","5843 Main Street","Austin","TX",64921, 508,"254-9002","05/14/01945" DATA "Cox, Collin","6457 Java Place","Newstead","CO",40318, 409,"234-0910","03/16/1957" DATA "Bailey, Alice","1012 Bugil Lane","Pleasent Hill","OR",98751, 203,"303-1202", "03/09/1970" DATA "Bates, Jamie", "9785 Turner Rd.", "Albecurkey","OH",65875, 542,"654-4561","07/31/1960" DATA "Freidman, Mary","3261 Nothingham Drive", "Green Valley", "MO",64351, 649,"275-4312","06/09/1967" DATA "Mustain, Dave","7349 Franklin Avenue", "Garden City", "NY", 11530, 582,"298-2452","07/03/1973" DATA "Juergensen, Chris","9787 Cardinal Road", "Alanta","GA",54807, 354,"473-3518","06/06/1965" DATA "Campese, Mike","1324 Parakeet Lane", "Sile", "AZ",89037, 613,"754-6132","09/04/1970" DATA "Hess, Tom","2457 Shoal Creek Trace", "Tom", "OK",64582, 864,"231-6154","03/08/1965" DATA "Davis, Jakie","9785 Oceola Lane", "Broken Bow", "CA",94678, 645,"582-4631","11/04/1983" DATA "Davis, Sandy","1302 Martin Downs Blvd.", "Whinchester Feild", "IO",61354,943,"231-3164","09/05/1964" DATA "Gilmoure, David","5634 Emulation Drive", "Nashville", "TN",45807, 582,"298-2452","09/23/1970" DATA "Smith, Joe","9875 Queen drive", "LittleHarbor", "CT",63158, 554,"845-8941","02/09/1964" DATA "Gugenhimer, James","8965 lake Blvd.", "Kanner", "AZ",34512, 454,"315-1302","04/15/1980" DATA "Walter, Cathy","6734 Crane Street", "Chardon", "NM",98752, 678,"631-1598","07/13/1984" DATA "Thomas, Richard","7878 Tropic Lane", "Shorline", "NV",64587, 345,"348-4658","10/23/1986" DATA "Reynolds, Rudy","2216 Coquanya Road", "Wilimton", "NC",31524, 978,"642-4587","12/23/1973" DATA "Nelson, Douglas","1107 Deer trace", "Madison", "WI",43287, 645,"289-1320","09/30/1965" DATA "Peirce, Carl","0065 Walter Way", "Allentown", "PA",14352, 312,"326-9451","06/03/1988" DATA "Malmsteen, Yngwie","1465 Carver Place", "Miami", "FL",44467, 643,"942-6345","02/06/1974" DATA "Rafael, Thelma","4356 Washington Cove", "Seatlle", "WA",13425, 857,"654-6124","08/04/1955" DATA "Stevens, Steve","7894 Thomas Avenue", "Lawton", "OK",65498, 465,"546-0125","09/02/1962" DATA "x","000 KFC lane","Chicken Coop", "KN",56489,000,"000-0000","04/15/1968" COLOR 12, 0 END SUB BirthdayAscend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF dob$(x) > dob$(i) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB NameAscend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF UCASE$(name$(x)) > UCASE$(name$(i)) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB NameDescend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF UCASE$(name$(x)) < UCASE$(name$(i)) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB PhoneAscend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF phone$(x) > phone$(i) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP areacode(x), areacode(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB PressAnyKey key$ = "" LOCATE 23, 32 PRINT "Press Any Key to Continue" DO key$ = INKEY$ LOOP UNTIL (key$ <> "") END SUB SUB PrintResults (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### \ \" ' COLOR 12, 0 PRINT TAB(15); addresstitle$ PRINT addressheadings$ PRINT border$ COLOR 14, 0 ' row = 4 FOR n = 1 TO 30 row = row + 1 set = 15 LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); phone$(n) IF n / set = INT(n / set) THEN PRINT STRING$(80, "=") CALL PressAnyKey row = 4 IF maxnum <> set THEN FOR r = 5 TO set + 5 LOCATE r, 1 PRINT STRING$(80, " ") NEXT r END IF END IF NEXT n LOCATE 5 + set, 1 PRINT STRING$(80, "=") END SUB SUB ReadInData (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) RESTORE DO LET n = n + 1 READ name$(n), address$(n), city$(n), state$(n), zip(n), areacode(n), phone$(n), dob$(n) LOOP UNTIL (n = 30) maxnum = n - 1 END SUB SUB SearchArea (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) lookupflag = 0 CLS INPUT "What AreaCode range would you like to find?"; areacode CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \\ \ \ \ ###### ### \ \" ' FOR n = 1 TO maxnum IF areacode >= areacode(n) THEN row = row + 1 PRINT TAB(24); "Your Search Request" LOCATE 3, 1 PRINT TAB(5); addresssheadings$ PRINT STRING$(60, "=") row = 4 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) lookupflag = 1 END IF NEXT n IF lookupflag = 0 THEN PRINT TAB(8); "The list contains no Area Code's in your number range." PRINT TAB(18); "Please make a new selection" END IF PRINT STRING$(60, "=") CALL PressAnyKey END SUB SUB SearchName (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) lookupflag = 0 CLS LINE INPUT "Enter The name you wish to find: "; name$ CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### ### \ \" ' PRINT TAB(24); "Your Search Request" LOCATE 3, 1 PRINT TAB(5); addresssheadings$ PRINT STRING$(60, "=") row = 4 FOR n = 1 TO maxnum IF UCASE$(name$(n)) = UCASE$(name$) THEN row = row + 1 LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) lookupflag = 1 END IF NEXT n IF lookupflag = 0 THEN LOCATE row + 1 PRINT TAB(15); "No address under that name was located." PRINT TAB(12); "Check the spelling or enter a new name." END IF PRINT STRING$(60, "=") CALL PressAnyKey END SUB SUB SearchZip (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) lookupflag = 0 CLS INPUT "What zip code range would you like to find?"; zip CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### ### \ \" ' row = 4 FOR n = 1 TO maxnum IF zip <= zip(n) THEN row = row + 1 PRINT TAB(24); "Your Search Request" LOCATE 3, 1 PRINT TAB(5); addresssheadings$ PRINT STRING$(60, "=") PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) lookupflag = 1 PRINT STRING$(60, "=") END IF NEXT n IF lookupflag = 0 THEN PRINT TAB(8); "The list contains no Zip Code's in your number range." PRINT TAB(18); "Please make a new selection" END IF PRINT STRING$(60, "=") CALL PressAnyKey END SUB I know the formatt is wrong...sorry but it's late and I will figrue that out some other day =\ |
Redid the AreaCode sub, learn from it and apply it to rest...by Pete (no login)Made a change in input statements. INPUT places a ? mark automatically in text. You added one, so there were always two. I removed the text ? marks to solve this. You needed two area code inputs to get a range. Try it, and apply the changes to the ZIP sub. 'night - Pete DECLARE SUB ReadInData (name$(), address$(), city$(), state$(), zip!(), areacode!(), phone$(), dob$(), maxnum!) DECLARE SUB NameAscend (name$(), address$(), city$(), state$(), zip!(), areacode!(), phone$(), dob$(), maxnum!) DECLARE SUB PrintResults (name$(), address$(), city$(), state$(), zip!(), areacode!(), phone$(), dob$(), maxnum!) DECLARE SUB NameDescend (name$(), address$(), city$(), state$(), zip!(), areacode!(), phone$(), dob$(), maxnum!) DECLARE SUB PhoneAscend (name$(), address$(), city$(), state$(), zip!(), areacode!(), phone$(), dob$(), maxnum!) DECLARE SUB BirthdayAscend (name$(), address$(), city$(), state$(), zip!(), areacode!(), phone$(), dob$(), maxnum!) DECLARE SUB SearchName (name$(), address$(), city$(), state$(), zip!(), areacode!(), phone$(), dob$(), maxnum!) DECLARE SUB SearchZip (name$(), address$(), city$(), state$(), zip!(), areacode!(), phone$(), dob$(), maxnum!) DECLARE SUB SearchArea (name$(), address$(), city$(), state$(), zip!(), areacode!(), phone$(), dob$(), maxnum!) DECLARE SUB PressAnyKey () REM Assignment: 1.10 REM Programmer: Ryan REM Date:03/30/04 ' DIM name$(1 TO 30), address$(1 TO 30), city$(1 TO 30), state$(1 TO 30), zip(1 TO 30), areacode(1 TO 30), phone$(1 TO 30), dob$(1 TO 30) ' howe$ = "continue" DO WHILE (howe$ = "continue") CLS LOCATE 2, 15 PRINT "Menu" LOCATE 4, 1 PRINT "1. Sort Names Alphabetically in Ascending Order" PRINT "2. Sort Names Alphabetically in Descending Order" PRINT "3. Sort Phone Numbers in Ascending Order" PRINT "4. Sort Birthdays in Ascending Order" PRINT "5. Search for a Specific Name" PRINT "6. Search for Zip Codes Within a Specific Range" PRINT "7. Search for Phone Numbers by Area Code" PRINT "8. Quit Program" INPUT "Please enter a number from 1 - 8: ", choice ' SELECT CASE choice CASE 1 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL NameAscend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 2 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL NameDescend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 3 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PhoneAscend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 4 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL BirthdayAscend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 5 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL SearchName(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 6 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL SearchZip(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 7 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL SearchArea(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 8 LET howe$ = "Stop" BEEP CLS LOCATE 10, 25 CALL PressAnyKey CASE ELSE PRINT "You entered a wrong number, try again." END SELECT LOOP ' REM Data Statements DATA "Jordan, Bill","5042 Sundance Lane","Tallahassee","FL",32309, 850,"668-9839","04/27/1951" DATA "Vanenberg, Eric","6045 Peavey Lane", "Alanta", "GA",45807, 582,"298-2452","09/24/1970" DATA "Malais, Chris","3824 Dean Street","New York","NY",34990, 434,"875-2004","06/07/1987" DATA "Garcia, Ricky","2648 Brian More Road", "Tulsa", "OK",74745, 500,"214-6264","04/20/1979" DATA "Corkin, James","1432 Stand Avenue", "Pheniox", "AZ",46599, 808,"548-3356","05/25/1972 DATA "Harisson, Paul","1653 Almond Lane","Bentonville", "AR",15246, 254,"987-3547",09/23/1984" DATA "McCartney, George","4997 Penny Lane", "Harris","MI",34651, 234,"567-8910","03/12/1965" DATA "Clame, Joe", "1313 Elm Street","Dallas", "TX",46957, 542,"578-5151","06/071957" DATA "Clark, Sam","5843 Main Street","Austin","TX",64921, 508,"254-9002","05/14/01945" DATA "Cox, Collin","6457 Java Place","Newstead","CO",40318, 409,"234-0910","03/16/1957" DATA "Bailey, Alice","1012 Bugil Lane","Pleasent Hill","OR",98751, 203,"303-1202", "03/09/1970" DATA "Bates, Jamie", "9785 Turner Rd.", "Albecurkey","OH",65875, 542,"654-4561","07/31/1960" DATA "Freidman, Mary","3261 Nothingham Drive", "Green Valley", "MO",64351, 649,"275-4312","06/09/1967" DATA "Mustain, Dave","7349 Franklin Avenue", "Garden City", "NY", 11530, 582,"298-2452","07/03/1973" DATA "Juergensen, Chris","9787 Cardinal Road", "Alanta","GA",54807, 354,"473-3518","06/06/1965" DATA "Campese, Mike","1324 Parakeet Lane", "Sile", "AZ",89037, 613,"754-6132","09/04/1970" DATA "Hess, Tom","2457 Shoal Creek Trace", "Tom", "OK",64582, 864,"231-6154","03/08/1965" DATA "Davis, Jakie","9785 Oceola Lane", "Broken Bow", "CA",94678, 645,"582-4631","11/04/1983" DATA "Davis, Sandy","1302 Martin Downs Blvd.", "Whinchester Feild", "IO",61354,943,"231-3164","09/05/1964" DATA "Gilmoure, David","5634 Emulation Drive", "Nashville", "TN",45807, 582,"298-2452","09/23/1970" DATA "Smith, Joe","9875 Queen drive", "LittleHarbor", "CT",63158, 554,"845-8941","02/09/1964" DATA "Gugenhimer, James","8965 lake Blvd.", "Kanner", "AZ",34512, 454,"315-1302","04/15/1980" DATA "Walter, Cathy","6734 Crane Street", "Chardon", "NM",98752, 678,"631-1598","07/13/1984" DATA "Thomas, Richard","7878 Tropic Lane", "Shorline", "NV",64587, 345,"348-4658","10/23/1986" DATA "Reynolds, Rudy","2216 Coquanya Road", "Wilimton", "NC",31524, 978,"642-4587","12/23/1973" DATA "Nelson, Douglas","1107 Deer trace", "Madison", "WI",43287, 645,"289-1320","09/30/1965" DATA "Peirce, Carl","0065 Walter Way", "Allentown", "PA",14352, 312,"326-9451","06/03/1988" DATA "Malmsteen, Yngwie","1465 Carver Place", "Miami", "FL",44467, 643,"942-6345","02/06/1974" DATA "Rafael, Thelma","4356 Washington Cove", "Seatlle", "WA",13425, 857,"654-6124","08/04/1955" DATA "Stevens, Steve","7894 Thomas Avenue", "Lawton", "OK",65498, 465,"546-0125","09/02/1962" DATA "x","000 KFC lane","Chicken Coop", "KN",56489,000,"000-0000","04/15/1968" COLOR 12, 0 END SUB BirthdayAscend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF dob$(x) > dob$(i) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB NameAscend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF UCASE$(name$(x)) > UCASE$(name$(i)) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB NameDescend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF UCASE$(name$(x)) < UCASE$(name$(i)) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB PhoneAscend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF phone$(x) > phone$(i) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP areacode(x), areacode(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB PressAnyKey key$ = "" LOCATE 23, 32 PRINT "Press Any Key to Continue" DO key$ = INKEY$ LOOP UNTIL (key$ <> "") END SUB SUB PrintResults (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### \ \" ' COLOR 12, 0 PRINT TAB(15); addresstitle$ PRINT addressheadings$ PRINT border$ COLOR 14, 0 ' row = 4 FOR n = 1 TO 30 row = row + 1 set = 15 LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); phone$(n) IF n / set = INT(n / set) THEN PRINT STRING$(80, "=") CALL PressAnyKey row = 4 IF maxnum <> set THEN FOR r = 5 TO set + 5 LOCATE r, 1 PRINT STRING$(80, " ") NEXT r END IF END IF NEXT n LOCATE 5 + set, 1 PRINT STRING$(80, "=") END SUB SUB ReadInData (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) RESTORE DO LET n = n + 1 READ name$(n), address$(n), city$(n), state$(n), zip(n), areacode(n), phone$(n), dob$(n) LOOP UNTIL (n = 30) maxnum = n - 1 END SUB SUB SearchArea (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) lookupflag = 0 CLS PRINT "What AreaCode range would you like to find?" INPUT "AreaCode low range"; areacode1 INPUT "AreaCode high range"; areacode2 CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \\ \ \ \ ###### ### \ \" row = 4 PRINT TAB(24); "Your Search Request" FOR n = 1 TO maxnum IF areacode(n) <= areacode2 AND areacode(n) >= areacode1 THEN row = row + 1 LOCATE row, 1 PRINT TAB(5); addresssheadings$ row = row + 1 PRINT STRING$(60, "=") PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) IF row >= 21 THEN LOCATE 25, 1: PRINT "Press any key for next screen."; : DO: LOOP WHILE INKEY$ = "" CLS row = 4 PRINT TAB(24); "Your Search Request" END IF lookupflag = 1 END IF NEXT n IF lookupflag = 0 THEN PRINT TAB(8); "The list contains no Area Code's in your number range." PRINT TAB(18); "Please make a new selection" END IF PRINT STRING$(60, "=") CALL PressAnyKey END SUB SUB SearchName (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) lookupflag = 0 CLS LINE INPUT "Enter The name you wish to find: "; name$ CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### ### \ \" ' PRINT TAB(24); "Your Search Request" LOCATE 3, 1 PRINT TAB(5); addresssheadings$ PRINT STRING$(60, "=") row = 4 FOR n = 1 TO maxnum IF UCASE$(name$(n)) = UCASE$(name$) THEN row = row + 1 LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) lookupflag = 1 END IF NEXT n IF lookupflag = 0 THEN LOCATE row + 1 PRINT TAB(15); "No address under that name was located." PRINT TAB(12); "Check the spelling or enter a new name." END IF PRINT STRING$(60, "=") CALL PressAnyKey END SUB SUB SearchZip (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) lookupflag = 0 CLS INPUT "What zip code range would you like to find"; zip CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### ### \ \" ' row = 4 FOR n = 1 TO maxnum IF zip <= zip(n) THEN row = row + 1 PRINT TAB(24); "Your Search Request" LOCATE 3, 1 PRINT TAB(5); addresssheadings$ PRINT STRING$(60, "=") PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) lookupflag = 1 PRINT STRING$(60, "=") END IF NEXT n IF lookupflag = 0 THEN PRINT TAB(8); "The list contains no Zip Code's in your number range." PRINT TAB(18); "Please make a new selection" END IF PRINT STRING$(60, "=") CALL PressAnyKey END SUB |
Polished your changes up a bit, Pete. Ryan, download this and test.by (Login Mac36)REM Assignment: 1.10 REM Programmer: Ryan REM Date:03/30/04 ' DIM name$(1 TO 30), address$(1 TO 30), city$(1 TO 30), state$(1 TO 30), zip(1 TO 30), areacode(1 TO 30), phone$(1 TO 30), dob$(1 TO 30) ' howe$ = "continue" DO WHILE (howe$ = "continue") CLS LOCATE 2, 15 PRINT "Menu" LOCATE 4, 1 PRINT "1. Sort Names Alphabetically in Ascending Order" PRINT "2. Sort Names Alphabetically in Descending Order" PRINT "3. Sort Phone Numbers in Ascending Order" PRINT "4. Sort Birthdays in Ascending Order" PRINT "5. Search for a Specific Name" PRINT "6. Search for Zip Codes Within a Specific Range" PRINT "7. Search for Phone Numbers by Area Code" PRINT "8. Quit Program" INPUT "Please enter a number from 1 - 8: ", choice ' SELECT CASE choice CASE 1 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL NameAscend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 2 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL NameDescend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 3 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PhoneAscend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 4 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL BirthdayAscend(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL PrintResults(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 5 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL SearchName(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 6 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL SearchZip(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 7 CALL ReadInData(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CALL SearchArea(name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CASE 8 LET howe$ = "Stop" BEEP CLS LOCATE 10, 25 CALL PressAnyKey CASE ELSE PRINT "You entered a wrong number, try again." END SELECT LOOP ' REM Data Statements DATA "Jordan, Bill","5042 Sundance Lane","Tallahassee","FL",32309, 850,"668-9839","04/27/1951" DATA "Vanenberg, Eric","6045 Peavey Lane", "Alanta", "GA",45807, 582,"298-2452","09/24/1970" DATA "Malais, Chris","3824 Dean Street","New York","NY",34990, 434,"875-2004","06/07/1987" DATA "Garcia, Ricky","2648 Brian More Road", "Tulsa", "OK",74745, 500,"214-6264","04/20/1979" DATA "Corkin, James","1432 Stand Avenue", "Pheniox", "AZ",46599, 808,"548-3356","05/25/1972 DATA "Harisson, Paul","1653 Almond Lane","Bentonville", "AR",15246, 254,"987-3547",09/23/1984" DATA "McCartney, George","4997 Penny Lane", "Harris","MI",34651, 234,"567-8910","03/12/1965" DATA "Clame, Joe", "1313 Elm Street","Dallas", "TX",46957, 542,"578-5151","06/071957" DATA "Clark, Sam","5843 Main Street","Austin","TX",64921, 508,"254-9002","05/14/01945" DATA "Cox, Collin","6457 Java Place","Newstead","CO",40318, 409,"234-0910","03/16/1957" DATA "Bailey, Alice","1012 Bugil Lane","Pleasent Hill","OR",98751, 203,"303-1202", "03/09/1970" DATA "Bates, Jamie", "9785 Turner Rd.", "Albecurkey","OH",65875, 542,"654-4561","07/31/1960" DATA "Freidman, Mary","3261 Nothingham Drive", "Green Valley", "MO",64351, 649,"275-4312","06/09/1967" DATA "Mustain, Dave","7349 Franklin Avenue", "Garden City", "NY", 11530, 582,"298-2452","07/03/1973" DATA "Juergensen, Chris","9787 Cardinal Road", "Alanta","GA",54807, 354,"473-3518","06/06/1965" DATA "Campese, Mike","1324 Parakeet Lane", "Sile", "AZ",89037, 613,"754-6132","09/04/1970" DATA "Hess, Tom","2457 Shoal Creek Trace", "Tom", "OK",64582, 864,"231-6154","03/08/1965" DATA "Davis, Jakie","9785 Oceola Lane", "Broken Bow", "CA",94678, 645,"582-4631","11/04/1983" DATA "Davis, Sandy","1302 Martin Downs Blvd.", "Whinchester Feild", "IO",61354,943,"231-3164","09/05/1964" DATA "Gilmoure, David","5634 Emulation Drive", "Nashville", "TN",45807, 582,"298-2452","09/23/1970" DATA "Smith, Joe","9875 Queen drive", "LittleHarbor", "CT",63158, 554,"845-8941","02/09/1964" DATA "Gugenhimer, James","8965 lake Blvd.", "Kanner", "AZ",34512, 454,"315-1302","04/15/1980" DATA "Walter, Cathy","6734 Crane Street", "Chardon", "NM",98752, 678,"631-1598","07/13/1984" DATA "Thomas, Richard","7878 Tropic Lane", "Shorline", "NV",64587, 345,"348-4658","10/23/1986" DATA "Reynolds, Rudy","2216 Coquanya Road", "Wilimton", "NC",31524, 978,"642-4587","12/23/1973" DATA "Nelson, Douglas","1107 Deer trace", "Madison", "WI",43287, 645,"289-1320","09/30/1965" DATA "Peirce, Carl","0065 Walter Way", "Allentown", "PA",14352, 312,"326-9451","06/03/1988" DATA "Malmsteen, Yngwie","1465 Carver Place", "Miami", "FL",44467, 643,"942-6345","02/06/1974" DATA "Rafael, Thelma","4356 Washington Cove", "Seatlle", "WA",13425, 857,"654-6124","08/04/1955" DATA "Stevens, Steve","7894 Thomas Avenue", "Lawton", "OK",65498, 465,"546-0125","09/02/1962" DATA "x","000 KFC lane","Chicken Coop", "KN",56489,000,"000-0000","04/15/1968" COLOR 12, 0 END SUB BirthdayAscend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF dob$(x) > dob$(i) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB NameAscend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF UCASE$(name$(x)) > UCASE$(name$(i)) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB NameDescend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF UCASE$(name$(x)) < UCASE$(name$(i)) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB PhoneAscend (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) FOR x = 1 TO maxnum - 1 FOR i = x + 1 TO maxnum IF phone$(x) > phone$(i) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP areacode(x), areacode(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x END SUB SUB PressAnyKey key$ = "" LOCATE 23, 32 PRINT "Press Any Key to Continue" DO key$ = INKEY$ LOOP UNTIL (key$ <> "") END SUB SUB PrintResults (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### \ \" ' COLOR 12, 0 PRINT TAB(15); addresstitle$ PRINT addressheadings$ PRINT border$ COLOR 14, 0 ' row = 4 FOR n = 1 TO 30 row = row + 1 set = 15 LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); phone$(n) IF n / set = INT(n / set) THEN PRINT STRING$(80, "=") CALL PressAnyKey row = 4 IF maxnum <> set THEN FOR r = 5 TO set + 5 LOCATE r, 1 PRINT STRING$(80, " ") NEXT r END IF END IF NEXT n LOCATE 5 + set, 1 PRINT STRING$(80, "=") END SUB SUB ReadInData (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) RESTORE DO LET n = n + 1 READ name$(n), address$(n), city$(n), state$(n), zip(n), areacode(n), phone$(n), dob$(n) LOOP UNTIL (n = 30) maxnum = n - 1 END SUB SUB SearchArea (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) lookupflag = 0 CLS PRINT "What AreaCode range would you like to find?" INPUT "AreaCode low range"; areacode1 INPUT "AreaCode high range"; areacode2 LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \\ \ \ \ ###### ### \ \" ' GOSUB NewPage FOR n = 1 TO maxnum IF areacode(n) <= areacode2 AND areacode(n) >= areacode1 THEN row = row + 1: LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n); IF row >= 21 THEN LOCATE 25, 1: PRINT "Press any key for next screen."; : DO: LOOP WHILE INKEY$ = "" GOSUB NewPage END IF lookupflag = 1 END IF NEXT n IF lookupflag = 0 THEN PRINT TAB(8); "The list contains no Area Code's in your number range." PRINT TAB(18); "Please make a new selection" ELSE LOCATE row, 1: PRINT border$ END IF CALL PressAnyKey EXIT SUB NewPage: CLS PRINT TAB(15); addresstitle$ PRINT TAB(24); "Your Search Request" PRINT TAB(5); addressheadings$; PRINT border$ row = 5 RETURN END SUB SUB SearchName (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) lookupflag = 0 CLS LINE INPUT "Enter The name you wish to find: "; name$ CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### ### \ \" ' PRINT TAB(24); "Your Search Request" LOCATE 3, 1 PRINT TAB(5); addresssheadings$ PRINT STRING$(60, "=") row = 4 FOR n = 1 TO maxnum IF UCASE$(name$(n)) = UCASE$(name$) THEN row = row + 1 LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) lookupflag = 1 END IF NEXT n IF lookupflag = 0 THEN LOCATE row + 1 PRINT TAB(15); "No address under that name was located." PRINT TAB(12); "Check the spelling or enter a new name." END IF PRINT STRING$(60, "=") CALL PressAnyKey END SUB SUB SearchZip (name$(), address$(), city$(), state$(), zip(), areacode(), phone$(), dob$(), maxnum) lookupflag = 0 CLS INPUT "What zip code range would you like to find?"; zip CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### ### \ \" ' row = 4 FOR n = 1 TO maxnum IF zip <= zip(n) THEN row = row + 1 PRINT TAB(24); "Your Search Request" LOCATE 3, 1 PRINT TAB(5); addresssheadings$ PRINT STRING$(60, "=") PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) lookupflag = 1 PRINT STRING$(60, "=") END IF NEXT n IF lookupflag = 0 THEN PRINT TAB(8); "The list contains no Zip Code's in your number range." PRINT TAB(18); "Please make a new selection" END IF PRINT STRING$(60, "=") CALL PressAnyKey END SUB |
THANKS GUYS!!!!by Ryan (no login)Thanks guys....I dont know with the way i feel this mornig if I could have made those changes..... |
Mac - Lookin' Good! Ryan, remember, you still have to apply those...by Pete (no login)changes to you find a zip code by range sub. Anyway, I just ran the "Polished" (Mac, I didn't know you were Polish) version. It looks great! I guess I did not get the boarder display for the search. I thought you were going for a border around each search return. I like this presentation better. So, now that functionality and display are covered, what do you think will be next? BTW - Ryan, if you read this post, thanks for fixin' the spelling of the names. By the time Idlûrest returns from "walk about" he will be able to view the program and not go into apoplexy. (He's a perfectionist. Catches me at spelling and punctuation errors all the time!) Someday, I may have to upgrade from my My Little Pony Spelling Helper for Atari Basic. I'll miss it. (lol) Pete |
I added some more names to go to page 3 and used GOSUBby (Login Mac36)REM Assignment: 1.10 REM Programmer: Ryan REM Date:03/30/04 ' DIM LastEntry AS INTEGER: ' Actual last data line CONST MaxEntries = 100: ' Most data lines I will have DIM name$(MaxEntries), address$(MaxEntries), city$(MaxEntries), state$(MaxEntries), zip(MaxEntries), areacode(MaxEntries), phone$(MaxEntries), dob$(MaxEntries) howe$ = "continue" DO WHILE (howe$ = "continue") CLS LOCATE 2, 15 PRINT "Menu" LOCATE 4, 1 PRINT "1. Sort Names Alphabetically in Ascending Order" PRINT "2. Sort Names Alphabetically in Descending Order" PRINT "3. Sort Phone Numbers in Ascending Order" PRINT "4. Sort Birthdays in Ascending Order" PRINT "5. Search for a Specific Name" PRINT "6. Search for Zip Codes Within a Specific Range" PRINT "7. Search for Phone Numbers by Area Code" PRINT "8. Quit Program" INPUT "Please enter a number from 1 - 8: ", choice ' SELECT CASE choice CASE 1 GOSUB ReadInData GOSUB NameAscend GOSUB PrintResults CASE 2 GOSUB ReadInData GOSUB NameDescend GOSUB PrintResults CASE 3 GOSUB ReadInData GOSUB PhoneAscend GOSUB PrintResults CASE 4 GOSUB ReadInData GOSUB BirthdayAscend GOSUB PrintResults CASE 5 GOSUB ReadInData GOSUB SearchName CASE 6 GOSUB ReadInData GOSUB SearchZip CASE 7 GOSUB ReadInData GOSUB SearchArea CASE 8 LET howe$ = "Stop" BEEP CLS LOCATE 10, 25 GOSUB PressAnyKey CASE ELSE PRINT "You entered a wrong number, try again." END SELECT LOOP COLOR 12, 0 SYSTEM PressAnyKey: key$ = "" LOCATE 23, 32 PRINT "Press Any Key to Continue" DO key$ = INKEY$ LOOP UNTIL (key$ <> "") RETURN ReadInData: IF LastEntry > 0 THEN RETURN: ' Data already loaded DIM n AS INTEGER DO LET n = n + 1 READ name$(n), address$(n), city$(n), state$(n), zip(n), areacode(n), phone$(n), dob$(n) LOOP UNTIL name$(n) = "x" LastEntry = n - 1 RETURN PrintResults: CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### \ \" ' COLOR 12, 0 PRINT TAB(15); addresstitle$ PRINT addressheadings$ PRINT border$ COLOR 14, 0 ' row = 4 FOR n = 1 TO LastEntry row = row + 1 set = 15 LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); phone$(n) IF n / set = INT(n / set) THEN PRINT STRING$(80, "=") GOSUB PressAnyKey row = 4 IF LastEntry <> set THEN FOR r = 5 TO set + 5 LOCATE r, 1 PRINT STRING$(80, " ") NEXT r END IF END IF NEXT n LOCATE 5 + set, 1 PRINT STRING$(80, "=") GOSUB PressAnyKey RETURN NameAscend: FOR x = 1 TO LastEntry - 1 FOR i = x + 1 TO LastEntry IF UCASE$(name$(x)) > UCASE$(name$(i)) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x RETURN NameDescend: FOR x = 1 TO LastEntry - 1 FOR i = x + 1 TO LastEntry IF UCASE$(name$(x)) < UCASE$(name$(i)) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x RETURN PhoneAscend: FOR x = 1 TO LastEntry - 1 FOR i = x + 1 TO LastEntry IF phone$(x) > phone$(i) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP areacode(x), areacode(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x RETURN BirthdayAscend: FOR x = 1 TO LastEntry - 1 FOR i = x + 1 TO LastEntry IF dob$(x) > dob$(i) THEN SWAP name$(x), name$(i) SWAP address$(x), address$(i) SWAP city$(x), city$(i) SWAP state$(x), state$(i) SWAP zip(x), zip(i) SWAP phone$(x), phone$(i) SWAP dob$(x), dob$(i) END IF NEXT i NEXT x RETURN SearchName: lookupflag = 0 CLS LINE INPUT "Enter The name you wish to find: "; name$ CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### ### \ \" ' PRINT TAB(24); "Your Search Request" LOCATE 3, 1 PRINT TAB(5); addresssheadings$ PRINT STRING$(60, "=") row = 4 FOR n = 1 TO LastEntry IF UCASE$(name$(n)) = UCASE$(name$) THEN row = row + 1 LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) lookupflag = 1 END IF NEXT n IF lookupflag = 0 THEN LOCATE row + 1 PRINT TAB(15); "No address under that name was located." PRINT TAB(12); "Check the spelling or enter a new name." END IF PRINT STRING$(60, "=") GOSUB PressAnyKey RETURN SearchZip: lookupflag = 0 CLS INPUT "What zip code range would you like to find?"; zip CLS LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \ \ \ \ \ ###### ### \ \" ' row = 4 FOR n = 1 TO LastEntry IF zip <= zip(n) THEN row = row + 1 PRINT TAB(24); "Your Search Request" LOCATE 3, 1 PRINT TAB(5); addresssheadings$ PRINT STRING$(60, "=") PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n) lookupflag = 1 PRINT STRING$(60, "=") END IF NEXT n IF lookupflag = 0 THEN PRINT TAB(8); "The list contains no Zip Code's in your number range." PRINT TAB(18); "Please make a new selection" END IF PRINT STRING$(60, "=") GOSUB PressAnyKey RETURN SearchArea: lookupflag = 0 CLS PRINT "What AreaCode range would you like to find?" INPUT "AreaCode low range"; areacode1 INPUT "AreaCode high range"; areacode2 LET addresstitle$ = "Ryan Cox's Adress Book" LET addressheadings$ = " Name Address City ST ZIP AreaCode Phone" LET border$ = STRING$(80, "=") LET addressformat$ = "\ \ \ \\ \ \ \ ###### ### \ \" ' GOSUB NewPage FOR n = 1 TO LastEntry IF areacode(n) <= areacode2 AND areacode(n) >= areacode1 THEN row = row + 1: LOCATE row, 1 PRINT USING addressformat$; name$(n); address$(n); city$(n); state$(n); zip(n); areacode(n); phone$(n); IF row >= 21 THEN LOCATE 25, 1: PRINT "Press any key for next screen."; : DO: LOOP WHILE INKEY$ = "" GOSUB NewPage END IF lookupflag = 1 END IF NEXT n IF lookupflag = 0 THEN PRINT TAB(8); "The list contains no Area Code's in your number range." PRINT TAB(18); "Please make a new selection" ELSE LOCATE row, 1: PRINT border$ END IF GOSUB PressAnyKey RETURN NewPage: CLS PRINT TAB(15); addresstitle$ PRINT TAB(24); "Your Search Request" PRINT TAB(5); addressheadings$; PRINT border$ row = 5 RETURN REM Data Statements DATA "Jordan, Bill","5042 Sundance Lane","Tallahassee","FL",32309, 850,"668-9839","04/27/1951" DATA "Vanenberg, Eric","6045 Peavey Lane", "Alanta", "GA",45807, 582,"298-2452","09/24/1970" DATA "Malais, Chris","3824 Dean Street","New York","NY",34990, 434,"875-2004","06/07/1987" DATA "Garcia, Ricky","2648 Brian More Road", "Tulsa", "OK",74745, 500,"214-6264","04/20/1979" DATA "Corkin, James","1432 Stand Avenue", "Pheniox", "AZ",46599, 808,"548-3356","05/25/1972 DATA "Harisson, Paul","1653 Almond Lane","Bentonville", "AR",15246, 254,"987-3547",09/23/1984" DATA "McCartney, George","4997 Penny Lane", "Harris","MI",34651, 234,"567-8910","03/12/1965" DATA "Clame, Joe", "1313 Elm Street","Dallas", "TX",46957, 542,"578-5151","06/071957" DATA "Clark, Sam","5843 Main Street","Austin","TX",64921, 508,"254-9002","05/14/01945" DATA "Cox, Collin","6457 Java Place","Newstead","CO",40318, 409,"234-0910","03/16/1957" DATA "Bailey, Alice","1012 Bugil Lane","Pleasent Hill","OR",98751, 203,"303-1202", "03/09/1970" DATA "Bates, Jamie", "9785 Turner Rd.", "Albecurkey","OH",65875, 542,"654-4561","07/31/1960" DATA "Freidman, Mary","3261 Nothingham Drive", "Green Valley", "MO",64351, 649,"275-4312","06/09/1967" DATA "Mustain, Dave","7349 Franklin Avenue", "Garden City", "NY", 11530, 582,"298-2452","07/03/1973" DATA "Juergensen, Chris","9787 Cardinal Road", "Alanta","GA",54807, 354,"473-3518","06/06/1965" DATA "Campese, Mike","1324 Parakeet Lane", "Sile", "AZ",89037, 613,"754-6132","09/04/1970" DATA "Hess, Tom","2457 Shoal Creek Trace", "Tom", "OK",64582, 864,"231-6154","03/08/1965" DATA "Davis, Jakie","9785 Oceola Lane", "Broken Bow", "CA",94678, 645,"582-4631","11/04/1983" DATA "Davis, Sandy","1302 Martin Downs Blvd.", "Whinchester Feild", "IO",61354,943,"231-3164","09/05/1964" DATA "Gilmoure, David","5634 Emulation Drive", "Nashville", "TN",45807, 582,"298-2452","09/23/1970" DATA "Smith, Joe","9875 Queen drive", "LittleHarbor", "CT",63158, 554,"845-8941","02/09/1964" DATA "Gugenhimer, James","8965 lake Blvd.", "Kanner", "AZ",34512, 454,"315-1302","04/15/1980" DATA "Walter, Cathy","6734 Crane Street", "Chardon", "NM",98752, 678,"631-1598","07/13/1984" DATA "Thomas, Richard","7878 Tropic Lane", "Shorline", "NV",64587, 345,"348-4658","10/23/1986" DATA "Reynolds, Rudy","2216 Coquanya Road", "Wilimton", "NC",31524, 978,"642-4587","12/23/1973" DATA "Nelson, Douglas","1107 Deer trace", "Madison", "WI",43287, 645,"289-1320","09/30/1965" DATA "Peirce, Carl","0065 Walter Way", "Allentown", "PA",14352, 312,"326-9451","06/03/1988" DATA "Malmsteen, Yngwie","1465 Carver Place", "Miami", "FL",44467, 643,"942-6345","02/06/1974" DATA "Rafael, Thelma","4356 Washington Cove", "Seatlle", "WA",13425, 857,"654-6124","08/04/1955" DATA "Rafael, Thelma","4356 Washington Cove", "Seatlle", "WA",13425, 857,"654-6124","08/04/1955" DATA "Rafael, Thelma","4356 Washington Cove", "Seatlle", "WA",13425, 857,"654-6124","08/04/1955" DATA "Rafael, Thelma","4356 Washington Cove", "Seatlle", "WA",13425, 857,"654-6124","08/04/1955" DATA "Stevens, Steve","7894 Thomas Avenue", "Lawton", "OK",65498, 465,"546-0125","09/02/1962" DATA "x","000 KFC lane","Chicken Coop", "KN",56489,000,"000-0000","04/15/1968" |
The Only thing new I JUST didby Ryan (no login)Ok...my last assignment was when the user selected the number 8 to quit that it rolled credit's...here is the final code http://www.network54.com/Forum/message?forumid=190883&messageid=1089235772 (Sorry 'bout the spaces) THE END! finally.....gotta go take some test's now Peace TheCoolRyan [Note to Ryan from Mac] I restored spaces AGAIN and made some minor mods and posted this in the Big Programs subforum, where it should have been all along. Let's keep it there so we don't fill the QBasic forum. Anyway, I added some new lines (Smith1,2,3,) and illustrated you have a severe bug. You have hard coded to just do two pages. Back to the drawing board!
|
It had a minor bugby (Premier Login iorr5t)Forum Owner You had PRINT NAME;(with a little help...) You need quotes around that. I fixed it when I reposted your program (see your post above that I modified) Good Luck. Mac |
Free downloads of Visual Studio.NET 2005 Express Beta Productsby Solitaire (Login Solitaire1)S If you missed out on the previous special offer, you can get this one right now. Free to everyone. http://lab.msdn.microsoft.com/express/ |
Solitaireby (Login Mac36)Twice you posted "Mac are you there" in the chat room, but you were not listed in the "members" box. Maybe your settings cause you to exit the chatroom immediately after posting. At any rate, I am still there for another 10 minutes if you want to try to get it working. [10 minutes are up. Good night!] Mac At the bottom of the Chat screen, is a panel with these things: Members - Click here to see who is in the chat room Options - Click here to set your Reload interval Exit - Obvious Message - Type your message here Send - It will go to the logged in members you select to - Make sure it says "all" if you want everybody to see it Set the Reload Interval to 5 or 10 seconds, and that is how often it will refresh. DON'T HIT THE IE REFRESH BUTTON (that clears everything)
|
Ha ha, It seems the Chat room even ats like the "Cone of Silence"by Pete (no login)On the old Get Smart series the Cone of Silence was requested by Max to insure the conversation between him and the "Chief" would not be overheard by anyone (It was a spy comedy.) Anyway, that darn thing never worked right. So far, I have seen three or four posts about the chat room and they all express how no one ever seems to connect there! I think the main forum some days, like today, has the chat room beat, even if it did work. Pete |
Missed it by THAT much!by (Login Mac36)LOL - Good old Max I've seen the chatroom work fine on other network54 forums. Don't know what our problem is. Mac |
*Good one Mac! - lol - I see JT has just fallen prey to the "Cone of silence" too.by Pete (no login) |
I was on there about 2 hours and no one cameby Jonathan Simpson (no login)Might there be a way to display on the forum here how many people are in the chatroom? That would probably help things along. |
My suggestion re: Chatroomby (Premier Login iorr5t)Forum Owner Post a new thread "I am in the chatroom" People will see it and log in if they can. It seems you need a network54 userid which is easy to get. Just sign up at www.network54.com. So far, nobody has successfully done this. :-( I would like to try sometime. When you give up, post a reply to your thread: "I am no longer there". I will delete the thread sooner or later when I see that. Mac |
*Ah, this ones available for non US'ersby (Login _JT_)
|
* Ah Crap, it needs at least Windows2000by JT (Login _JT_) |
what do u run?by (no login)anyways, looks pretty good, although no optimizer. Seems the biggest enhancements are with C#, the C++ language and interface is pretty much identical between visual studio 2003 and 2005. Probably a few API enhancements for '05.... |
*W98, i guess i'll stuck to my version then (or download a borland one)by JT (Login _JT_)
|
*I am actually going to use this. Thx.by (Login PhyloGenesis)R * |