Solved

How to add characters?

Posted on 2003-11-23
4
196 Views
Last Modified: 2010-05-01
Gd evening,

my program takes input of 2 ASCII characters. However, when I store this data, it has to be in 4 byte format thus eg: 18 has to be 0018 before it can be stored. Could anyone enlightment me on this subject ?
0
Comment
Question by:leeh0003
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
ennixo earned 50 total points
ID: 9805743
very easy :

TheInputString = "00" & TheInputString
0
 

Expert Comment

by:whose_da_n00b
ID: 9805914
the above one adds 00 to everything -- therefore 100 would become 00100 not 0100.

if TheInputString <= 9 then TheFinalString = "000" & TheInputString
if TheInputString <= 99 then TheFinalString = "00" & TheInputString
if TheInputString <= 999 then TheFinalString = "0" & TheInputString
if TheInputString <= 9999 then TheFinalString = TheInputString

use that instead. that makes single digit number 000#, double digit numbers 00##, triple digit numbers 0### and quad-digit numbers ####
0
 
LVL 5

Expert Comment

by:ennixo
ID: 9805930
leeh0003 said :
    "my program takes input of 2 ASCII characters"

2 characters
0
 

Expert Comment

by:whose_da_n00b
ID: 9805936
oops, nvm mine then, sorry... =$
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now