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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Split String with No Deliminator

Status
Not open for further replies.

SpankYou

Programmer
Feb 24, 2003
211
GB
Hey,

Basically I have built an automated Audit program, and part of this program lists every program in the uninstall directory held in the registry, along with the Version and Date. A problem is that the date is returned as 20030911.

What I would like to do is take this date and put the first 4 numbers into an InstallYear variable, the second two numbers into an InstallMonth Variable, and the last two numbers into an InstallDay Variable. I've done this sort of thing before with a deliminator, but I am not really sure where to start with this one.

Thanks For Any Help In Advance

Cheers

Sam

"You couldn't fool your mother on the foolingest day of your life if you had an electrified fooling machine." - Homer
 
Ignore this I have just figured a way out...

I've posted it below If anyone was wondering...

Cheers

Sam...

TestVariable = 20030911

'There are three functions to split a string:

'1. Right( String, CharacterCount ) - Returns the number of characters from the right)
'example:
InstallDay = Right(TestVariable, 2)

'2. Left( String, CharacterCount ) - Returns the number of characters from the left)
'example:
InstallYear = Left(TestVariable, 4)

'3 Mid(String, StartCharacter, Character Length) - Returns the characters in
'String starting with the StartCharacter and ending with the EndCharacter
'example:
InstallMonth = Mid(TestVariable, 5, 2)

"You couldn't fool your mother on the foolingest day of your life if you had an electrified fooling machine." - Homer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top