|
-
Aug 31st, 2000, 11:12 PM
#1
Thread Starter
Lively Member
how do i convert an octal (base 8) value to a decimal value (base 10)
Frankie Weindel
VB 6 Learning Edtion SP3
-
Aug 31st, 2000, 11:17 PM
#2
_______
<?>
May or may not help...
Val(string)
The required stringargument is any validstring expression.
Remarks
The Val function stops reading the string at the first character it can't recognize as part of a number. Symbols and characters that are often considered parts of numeric values, such as dollar signs and commas, are not recognized. However, the function recognizes the radix prefixes &O (for octal) and &H (for hexadecimal). Blanks, tabs, and linefeed characters are stripped from the argument.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 31st, 2000, 11:20 PM
#3
Thread Starter
Lively Member
Frankie Weindel
VB 6 Learning Edtion SP3
-
Aug 31st, 2000, 11:29 PM
#4
Addicted Member
-
Aug 31st, 2000, 11:37 PM
#5
Originally posted by Bjwbell
How do you do binary
Base 10 to Binary:
Code:
Const a = 1
Const b = 2
Const c = 4
Const d = 8
Const e = 16
Const f = 32
Const g = 64
Const h = 128
Const i = 256
Public Function BinConv(intval As Long) As String
If Int(intval) >= Int(i) Then
BinConv = BinConv & 1
intval = intval - i
Else
BinConv = BinConv & 0
End If
Debug.Print Int(intval) & " " & BinConv
If Int(intval) >= Int(h) Then
BinConv = BinConv & 1
intval = intval - h
Else
BinConv = BinConv & 0
End If
Debug.Print Int(intval) & " " & BinConv
If Int(intval) >= Int(g) Then
BinConv = BinConv & 1
intval = intval - g
Else
BinConv = BinConv & 0
End If
Debug.Print Int(intval) & " " & BinConv
If Int(intval) >= Int(f) Then
BinConv = BinConv & 1
intval = intval - f
Else
BinConv = BinConv & 0
End If
Debug.Print Int(intval) & " " & BinConv
If Int(intval) >= Int(e) Then
BinConv = BinConv & 1
intval = intval - e
Else
BinConv = BinConv & 0
End If
Debug.Print Int(intval) & " " & BinConv
If Int(intval) >= Int(d) Then
BinConv = BinConv & 1
intval = intval - d
Else
BinConv = BinConv & 0
End If
Debug.Print Int(intval) & " " & BinConv
If Int(intval) >= Int(c) Then
BinConv = BinConv & 1
intval = intval - c
Else
BinConv = BinConv & 0
End If
Debug.Print Int(intval) & " " & BinConv
If Int(intval) >= Int(b) Then
BinConv = BinConv & 1
intval = intval - b
Else
BinConv = BinConv & 0
End If
Debug.Print Int(intval) & " " & BinConv
If Int(intval) >= Int(a) Then
BinConv = BinConv & 1
intval = intval - a
Else
BinConv = BinConv & 0
End If
End Function
-
Aug 31st, 2000, 11:55 PM
#6
Addicted Member
-
Sep 1st, 2000, 12:09 AM
#7
Pikachu_902, I searched http://www.planet-source-code.com and a few results came up on Base Conversion.
-
Sep 1st, 2000, 12:38 AM
#8
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 1st, 2000, 08:57 AM
#9
Thread Starter
Lively Member
I figured it out awhile ago from my first reply
Frankie Weindel
VB 6 Learning Edtion SP3
-
Sep 1st, 2000, 09:30 AM
#10
Fanatic Member
-
Sep 12th, 2000, 08:34 AM
#11
transcendental analytic
Yep, i think Hesaidjoe should be Guru, i didn't know the "&O" thing for instance, but i don't think you can convert to base 23 with a "&Q" hehe 
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 12th, 2000, 08:57 AM
#12
Fanatic Member
In Australia they'd award him the order of the Dead-Set-Legend !!
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Sep 12th, 2000, 10:19 AM
#13
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 13th, 2000, 09:51 AM
#14
Fanatic Member
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Sep 14th, 2000, 03:15 AM
#15
transcendental analytic
eh, no, that was a joke, like DSL connection
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|