Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert string type to integer

Status
Not open for further replies.

mc81773

Programmer
Sep 19, 2002
6
US
I want to convert the string type to integer and then add 1 to that number. Then convert it back to string.
This is my code now and doesn't work.

'Read the control file record
ControlRecord = Controlfile.ReadLine
'Get the control number, This is string type
LastControlNum = Mid(ControlRecord, 25, 7)
LastControlNum = LastControlNum + 1

Thanks in advacne
 
Try:

LastControlNum = CInt(LastControlNum) + 1

And convert back by using:

NewStr = CStr(LastControlNum)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top