|
-
Dec 20th, 2006, 11:04 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Qbasic to VB6
I started with:
2010 Rem ...... THIS IS FILE "NUMBER.BAS"
2020 Rem Converted by Mike Sessi for Elise Allen High School 9/25/2002
2030 Rem ***************************************************************
2040 Rem ** PROGRAM TO INPUT INTEGERS IN DIGITS & OUTPUT IN ENGLISH **
2050 Rem ***************************************************************
2090
2100 Rem ...... MAPS
2110 Dim NUMBER$
2120 Dim ONENAME(19) As String
2130 Dim TENNAME(9) As String
2140 Dim TRIONAME(20) As String
2150 Dim TRIO$
2190
2200 Rem ...... READ IN DATA
2210 For I = 1 To 19: READ ONENAME(I): Next I
2220 For I = 1 To 9: READ TENNAME(I): Next I
2230 For I = 1 To 20: READ TRIONAME(I): Next I
2290
2300 Rem ...... DATA
2310 Data ONE, TWO, THREE, FOUR, FIVE
2320 Data SIX, SEVEN, EIGHT, NINE, TEN
2330 Data ELEVEN, TWELVE, THIRTEEN, FOURTEEN, FIFTEEN
2340 Data SIXTEEN, SEVENTEEN, EIGHTEEN, NINETEEN
2345
2350 Data TEN, TWENTY, THIRTY, FORTY, FIFTY
2360 Data SIXTY, SEVENTY, EIGHTY, NINETY
2370
2380 Data M, B, TR, QUADR, QUINT
2390 Data SEXT, SEPT, Oct, NON, DEC
2400 Data UNDEC, DUODEC, TREDEC, QUATTUORDEC, QUINDEC
2410 Data SEXDEC, SEPTENDEC, OCTODEC, NOVEMDEC, VIGINT
2490
2500 Rem ...... INPUT LOOP
2510 Print
2520 INPUT "TYPE NUMBER : ", NUMBER$
2530 If (NUMBER$ = "0") Then Print "ZERO";: GoTo 2800
2540 L = Len(NUMBER$)
2550 If (L > 66) Then Print "ERROR---NUMBER > 66 DIGITS": GoTo 2500
2560 If (L / 3 <> Int(L / 3)) Then NUMBER$ = "0" + NUMBER$: GoTo 2540
2570 NTRIOS = L / 3
2590
2600 Rem ...... TRIO OUTPUT LOOP
2610 For NTRIO = NTRIOS - 1 To 0 Step -1
2620 TRIO$ = Mid$(NUMBER$, 3 * (NTRIOS - NTRIO) - 2, 3)
2630 HUNDREDS = Val(Mid$(TRIO$, 1, 1))
2640 TENS = Val(Mid$(TRIO$, 2, 1))
2650 ONES = Val(Mid$(TRIO$, 3, 1))
2660 If (HUNDREDS > 0) Then Print ONENAME(HUNDREDS); " HUNDRED ";
2670 TAOS = TENS * 10 + ONES
2680 If (TAOS = 0) Then GoTo 2750
2690 If (TAOS < 20) Then Print ONENAME(TAOS); " ";: GoTo 2750
2700 Print TENNAME(TENS);
2710 If (ONES > 0) Then Print "-"; ONENAME(ONES);
2720 Print " ";
2740
2750 Rem ...... OUTPUT NAME OF 1000**NTRIO
2760 If (NTRIO = 0 Or TRIO$ = "000") Then GoTo 2780
2770 If (NTRIO = 1) Then Print "THOUSAND "; Else Print TRIONAME(NTRIO - 1); "ILLION ";
2780 Next NTRIO
2790
2800 Rem ...... END OF OUTPUT
2810 Print
2820 GoTo 2500
2890
2900 Rem ...... END OF PROGRAM
2910 End
And I ended with: a Number to Words.. 66 digits
http://www.vbforums.com/showthread.p...69#post2724769
Alpha Micro: Alpha Basic, AS400 V5r2, EDI (Trusted Link/ Inovis.com),Access AS/400 via VB6, Qbasic for data conversions. A mix of Hardware too. ASCII Table , New Number to Words/66 digits , AS/400(v5r2) VB6 Viewer/Ask for code(ODBC) ^ What Is Transferring? , Check your Ports #Perfect Passwords , *Slide Bar Example , Logoff, Restart, Shut-Down PC *Keep Form On Top , Opaque Form ^ Create Objects at Run Time @ Check Key Caps Locks # GetTickCount(System Up Time) * Convert text to Excel & Collected Icons + Resize: Form/Text box ^ PC GateWay via Shell $ Drag & Drop Game ! PopUpMenu *Print File/no Open# Timer on Mult Forms ~ Splash & Mult Forms & Lots of Comments + Random/Timer/Guess * Dec >Hex >Oct >Bin % Get MAC (NIC) < saving to Registry > Wookiee Cookies \ BackUpDisk / World Conection SpeedTest $ Glossary Commonly Used Terms # phonetic list @ Detailed Computer Scan
When posting Code, Use tags.. [CODE] *Your Code* [/CODE]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|