Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Convert from base 50 to a string using visual basic

I am reading an ascii file in which dollar amounts are stored in base 50. I need to convert base 50 to a string.
0
Trentonhome
Asked:
Trentonhome
  • 2
  • 2
  • 2
1 Solution
 
moorhouselondonCommented:
So $51 is stored in this file as 101?
0
 
TrentonhomeAuthor Commented:
$ characters are not stored in the ascii file.
Another point to note is that all values 10000 and above are converted to base 50 encoding. Here is a sumary of what is being done while storing the values in the ascii file

No special encoding is used if the value will fit in the field.  If the value is too large to fit in the field, the first 4 characters are encoded using Base50 encoding, which allows 4 digits to fit into those 4 characters.
Encoded              Decoded.
00099I                   999
09999I                99,999
99999H               999,998
99999I               999,999
!(!!0{             1,000,000
!r!!0{            10,000,000
!ken0G             8,388,607
!ken0P            -8,388,607
!q~~9I             9,999,999
+~~~9I            99,999,999
+~~~9R           -99,999,999
_!!!0{           100,000,000    '"_" indicates overflow condition
_!!!0}          -100,000,000    '"_" indicates overflow condition
 
These use an 8 character overpunch field.
Encoded              Decoded.
9999999I          99,999,999
!q~~999I         999,999,999
!q~~999R        -999,999,999
!r!!000{       1,000,000,000
!r!!000}      -1,000,000,000
0
 
moorhouselondonCommented:
I have come across some wacky encoding schemes in my time, but I think this is the weirdest I have ever seen.  
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
kbens0nCommented:
http://www.4guysfromrolla.com/webtech/032400-1.shtml
"VBScript does not natively support Base N notation or calculations; nevertheless, since both SQL and COM objects support Base N, the ability to convert..."
0
 
TrentonhomeAuthor Commented:
Thanks _ Used the code it works great.
0
 
kbens0nCommented:
Thanks -=VERY MUCH=- for the points and grade !
That was very *NICE* of you ! Good Luck.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now