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
Solved

How to add characters?

Posted on 2003-11-23
4
199 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

809 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