Solved

Convert from base 50 to a string  using visual basic

Posted on 2006-07-13
6
157 Views
Last Modified: 2008-03-06
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
Comment
Question by:Trentonhome
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 31

Expert Comment

by:moorhouselondon
ID: 17102758
So $51 is stored in this file as 101?
0
 

Author Comment

by:Trentonhome
ID: 17103898
$ 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
 
LVL 31

Expert Comment

by:moorhouselondon
ID: 17104052
I have come across some wacky encoding schemes in my time, but I think this is the weirdest I have ever seen.  
0
Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

 
LVL 6

Accepted Solution

by:
kbens0n earned 500 total points
ID: 17115153
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
 

Author Comment

by:Trentonhome
ID: 17115784
Thanks _ Used the code it works great.
0
 
LVL 6

Expert Comment

by:kbens0n
ID: 17115814
Thanks -=VERY MUCH=- for the points and grade !
That was very *NICE* of you ! Good Luck.
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
As computers become more powerful, jobs will be replaced with artificial intelligence, leaving no place in the future for humans in the workforce. In the oncoming technological revolution, the staggering change to human mind labor will prove the ski…
The Bounty Board allows you to request an article or video on any technical topic, or fulfill a bounty request to earn points. Watch this video to learn how to use the Bounty Board to get the content you want, earn points, and browse submitted bount…
Articles on a wide range of technology and professional topics are available on Experts Exchange. These resources are written by members, for members, and can be written about any topic you feel passionate about. Learn how to best write an article t…

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question