Link to home
Start Free TrialLog in
Avatar of Matt_Unsworth
Matt_Unsworth

asked on

General pointer needed (Just a quickie!)

Hi,

I'm new to the game - only just mastering VB fundamentals and don't have access to a  manual that provides an answer to this one. Can anyone help?

I am building a front end that sends data to /returns data from an AS/400 via .dll objects talking to AS400 data queues.

The nature of the AS400 dictates that the data is sent/received as a text string yet it will consist of a mixture of text & numeric values.

I need to be able to convert interger values to fixed length text strings that can then be re-converted at the AS400 end.

e.g

I have an item counter that takes up seven 'spaces' of the data block, passed to the data queue

If the integer value of that counter is 26

     Dim strVar as String * 7

     intVar Cstr strVar

Then strVar would look like this "26     "

I need to be able to send this data back to the AS400 as "0000026"

Any pointers?

Cheers,

Matt
ASKER CERTIFIED SOLUTION
Avatar of jetforce
jetforce

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TigerZhao
TigerZhao

strVar = format(intVar, "0000000")
Avatar of Matt_Unsworth

ASKER

Cheers,

Clean, simple effective; (why did I not think of that, DOH.........)

Matt