Avatar of Bob Schneider
Bob SchneiderFlag for United States of America

asked on 

Subtraction v Hex2Dec in vbscript

Lets say I had to iterate through a loop of 1000 rows of a text file and at each row I had to take a value and do one of the following:
1) If the value were a decimal value with 6 digits, subtract 100,000 from the value
2) If the value were a hex value, convert it to decimal.

Which would be quicker/use fewer resources?

Thank you!
VB Script

Avatar of undefined
Last Comment
Bill Prew
SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Bill Prew
Bill Prew

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of Bill Prew
Bill Prew

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of Bill Prew
Bill Prew

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Bob Schneider
Bob Schneider
Flag of United States of America image

ASKER

Thanks everyone.  Here is more information:  I time races 5k, marathon, trithlons, etc) and I encode my own RFID tags.  I have to make sure that there is little or no reasonable chance of conflicting with things like rfid tags that are put into shoes, etc.  However, ultimately I have to have decimal numbers to work with.  So the two options I have landed on are these:

1) I could encode the tags using 6 decimal digits (I have never seen a six-digit decimal rfid value come through my system).  For instance, rfid tag 100001 would be used for bib #1, rfid tag 100002 would go on bib #2, etc.  Then I just loop through and subtract 100000 from each tag before processing the results.

2) I could encode the tags using hex numbers and just convert to decimal prior to processing the results.

I prefer the first method because it is human-readable but it is even more important to process quickly.

Thanks for any additional clarity you can provide.  I will look at the above links, code, suggestions, ...
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
VB Script
VB Script

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.

39K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo