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

Left() does not work anymore 2

Status
Not open for further replies.

IlseDC

Programmer
Mar 24, 2003
49
BE
Hi,

I installed VB6 on a new PC.
Now I want to compile my existing VB application on my new PC (application was written on other PC), but the compiler does not recognize the function Left() anymore.

How can that?
The Mid() function does work.
But I don't have the intention to change all the Left() to Mid().

Does anyone know what the problem is?

Thanks.
Ilse
 
Are you sure that you typing correct. Does the function Right() work?
 
Yes, I'm typing it correct.
The right function does not work.

I did not change my sources.
I just copied the sources from my old PC and I tried to compile them on my new PC. On my new PC VB6 does not recognize LEFT() and RIGHT().


 
Can you give an example of the code that is not "working". Also, please describe in more detail what you mean by "not working".
 


Check the project references to see that none of the selected references is labled "MISSING."

It's possible one of the references is not present on your new PC...


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
There is no reference missing.

Here is my code:
myString = Left(strBuffer, lngLen)

When I run my application I get an error.
The compiler thinks that "Left" is an array, and does not see that this is the Left() function.

I changed my code to mystring = VBA.Left(strBuffer, lngLen) and this does work.

What reference must I add so that I don't have to add "VBA." before the left function?

Ilse
 
Have you checked that you have not used left as a variable or function.
 
Left is not used as variable or function.

The strange thing is that the sources can be compiled on my old PC. I copied them to my new PC (without changing the code) and there the sources can not be compiled.
 
Are you using it with correct syntax?
dim x as string
x = left ("Hostess" , 4)
x should equal "Host"

If you just have left with no arguments then the compiler will think it is an array ..... left () etc.
 
I am saying that perhaps the variables were not initialized properly before the statement in question was performed. Causing the compiler to think it is an array.
 
1. Put your cursor on the word "Left" and hit SHIFT-F2.
What happens?

2. What happens when you use the Right function?

3. Does the Left$() function work?

If Left$(), Right(), Right$() work, then you probably have a Control name, (or variable name as petevick mentioned), called "Left".

 
I found the problem.

I have a DLL "dcString.DLL".
On my new PC I installed a new version of this DLL.
This version has an enumeration with left and right.
On my old PC it was still the old DLL without enumeration.
So the new DLL caused the problem.

Thanks all for your advice!

Ilse
 
I am also having a problem with LEFT() and RIGHT()

These two functions were working UNTIL I Added a

WORD report to the Project....

Does WORD have LEFT 'n RIGHT as Constants ?

( Can't see how Military using any Programming Language that does not have Left and Right wotking properly.... )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top