VB Question (Resolved)

WhoIsThat

Senior member
Dec 27, 2002
362
0
0
Got this code somewhere, and I know it's valid code. However, it would not compile on my machine, saying class or project not found.

strX = Left$(strX, ilength - 1)
strY = RTrim$(strY)

All the references are correct and in place. I am quite certain of that.

Obviously, Left and RTrim are standard functions in VB 6, but with that "$" sign, VB doesn't seem to recognize the functions anymore. However, this usage is all over the place and I am sure it is not a mistake.

Any help would be appreciated. Thanks.


 

Apathetic

Platinum Member
Dec 23, 2002
2,587
6
81
Click on the "Project" menu and then "References" menu. DO any of the items marked with a checkmark say "... not found..."?

VB gets wierded out sometimes when it can't resolve a project reference.

The "$" is an old school style for indicating the function will return a string.

Dave
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Sure you aren't running VB.Net instead of VB6? The .Net version threw out support for a lot of legacy functions.
 

WhoIsThat

Senior member
Dec 27, 2002
362
0
0
Well, I have both VB .NET and VB 6. I also have .NET framework installed. MS explicitly say they can co-exist, and I am positive that the code source of this person also has both installed. (Unfortunately, I am unable to ask that person).

Somebody I was talking to just mentioned to me that "left$" is the same as "left" except it is much faster with restrictions on data type.

If anyone knows the answer, please post. I will also let everyone know if I find out anything.

Thanks.
 

WhoIsThat

Senior member
Dec 27, 2002
362
0
0
Originally posted by: Apathetic
Click on the "Project" menu and then "References" menu. DO any of the items marked with a checkmark say "... not found..."?

VB gets wierded out sometimes when it can't resolve a project reference.

The "$" is an old school style for indicating the function will return a string.

Dave

Nothing is missing. If all else faills, I will just remove all the "$"s, though I am trying not to change the code at this point.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Originally posted by: WhoIsThat
Well, I have both VB .NET and VB 6. I also have .NET framework installed. MS explicitly say they can co-exist, and I am positive that the code source of this person also has both installed. (Unfortunately, I am unable to ask that person).

Somebody I was talking to just mentioned to me that "left$" is the same as "left" except it is much faster with restrictions on data type.

If anyone knows the answer, please post. I will also let everyone know if I find out anything.

Thanks.
Well, when you went to compile were you running in the VB6 IDE or the VB.Net IDE? That fact that you have both installed won't let you create .Net code in VB6 or vice versa.

But yes, a quick trip to online help / MSDN library / MSDN website will tell you that left and left$ are both (string, length).
 

WhoIsThat

Senior member
Dec 27, 2002
362
0
0

The VB problem was resolved. It turned out it had nothing to do with VB at all. I had one of the needed third-party DLLs, but did not go through the full installation process for that program (a zip program) and so after I installed the zip program, all the problems magically went away. :)

Thanks!!

 

Apathetic

Platinum Member
Dec 23, 2002
2,587
6
81
Originally posted by: WhoIsThat
The VB problem was resolved. It turned out it had nothing to do with VB at all. I had one of the needed third-party DLLs, but did not go through the full installation process for that program (a zip program) and so after I installed the zip program, all the problems magically went away. :)

Thanks!!

No problem. I thought it was something like that and I was hoping the offending ActiveX control would show up under the references section as "missing".

Dave