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

stupid question

Status
Not open for further replies.

MartDawg

Programmer
Jan 14, 2004
33
US
I have never used Visual Basic 6.0 before. I have used vbscript before.

How do I concatanate a variable into a string in Visual Basic 6.0?

For example...

I have a fuction call where I pass in the path and an image name, The path is always the same, but the image is always a variable.

1. strImage = "someimagename"

2. some function ("C:\somedirectory\strImage.bmp")


how do I write the second line to concatanate the variable to the string, in vbscript it would be something like this...

some function ("C\somedirectory\&strImage&.bmp")

How is this in VB?

Sorry for the dumb question, but I've never done VB but am trying to edit some code.
 
Hi,

You were close...
Code:
Function FullFileName(strImage as String) as String
  FullFileName = "C\somedirectory\" & strImage & ".bmp"
End Function


Skip,

[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top