?
Solved

How to add characters?

Posted on 2003-11-23
4
Medium Priority
?
204 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
[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
4 Comments
 
LVL 5

Accepted Solution

by:
ennixo earned 150 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 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