×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Left() does not work anymore
2

Left() does not work anymore

Left() does not work anymore

(OP)
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

RE: Left() does not work anymore

Are you sure that you typing correct. Does the function Right() work?

RE: Left() does not work anymore

(OP)
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().


RE: Left() does not work anymore

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

RE: Left() does not work anymore



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

RE: Left() does not work anymore

(OP)
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

RE: Left() does not work anymore

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

RE: Left() does not work anymore

(OP)
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.

RE: Left() does not work anymore

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.

RE: Left() does not work anymore

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.

RE: Left() does not work anymore

(OP)
Yes, I use the correct syntax !

RE: Left() does not work anymore

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".

RE: Left() does not work anymore

(OP)
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

RE: Left() does not work anymore

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.... )

RE: Left() does not work anymore

Then use LEFT$() or VBA.LEFT$()

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close