Working with file names in VB - TechRepublic
Question
May 8, 2008 at 08:26 AM
jiminpa

Working with file names in VB

by jiminpa . Updated 18 years, 1 month ago

I have a file name I am working with in a particular piece of code I am attempting to write (I am not a programmer). I need to work with different pieces of this file name in different parts of my code.

For example, let’s say I have a file call filename.c00. In one part of my code I need the part of the file name “filename.c” and in a different part of the code I need the part of the filename “00”.

I am caputring the filename in a text box on a form. I have tried to use

Right(textbox1.text, -4)

but the comiler complains that I need a ‘)’ where the comma is. So I tried

Right(textbox1.text – 4)

but the compiler is treating the data as an interger but the data is actually alphanumerics. I tried Dimming a variable and setting it as a string and making the variable equal to right(textbox1.text – 4) but had the same result.

My Google searches have been fruitless, likely I’m not using the right key words.

This discussion is locked

All Comments