Problem with Left Function
Error: Mismatched Type
Sunday, May 15, 2005 by Sranshaft | Discussion: DesktopX
[code]
134 If Len(track) > TrackChar Then
135 Track = Left(Track, TrackChar)
136 DesktopX.Object("widget_itunes_track").Text = Track
[/code]
The code keeps coming back as an error though
Type Mismatch: "Left"
Line: 135
Code: (not available)
What could be causing this error? I checked the VBScript website at Microsoft and I am using the function correctly.
Any ideas?
Reply #2 Sunday, May 15, 2005 8:21 PM
Any other ideas???
Reply #3 Sunday, May 15, 2005 11:15 PM
var=var-0
then var is now a numeric value and not a string. No idea why it does that, however!
Reply #4 Monday, May 16, 2005 11:22 AM
| var=var-0 |
Or use var=CInt(var) (assuming you are using an Integer) This ensures you get an Integer object. Use CSng or CDbl if you need a floating number.
Sranshaft:
So the values passed on to the Left function is 0 or more and less than the length of the Track string? Left will return an error if the length agrument is less than 0 or higher than the numbers of characters in the string being processed.
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Sunday, May 15, 2005 11:15 AM