Seeker Posted October 12, 2005 Share Posted October 12, 2005 Why does the expression strHx = left(s,inStr(s,",")-1) cause the error message Invalid procedure call or argument: 'left', while the expression strHx = left(s,inStr(s,",")+1) does not? I want to parse the string s and bring back everything to the left of the first comma. Any help would be appreciated. Link to comment Share on other sites More sharing options...
Webworldx Posted October 13, 2005 Share Posted October 13, 2005 strHx = left(s,inStr(s,",")-1)Works fine for me. Why not:strHx = split(s,",")(0)though? Link to comment Share on other sites More sharing options...
Seeker Posted October 13, 2005 Author Share Posted October 13, 2005 strHx = left(s,inStr(s,",")-1)Works fine for me. Why not:strHx = split(s,",")(0)though?<{POST_SNAPBACK}> I think I understand what's going on here. If no comma is found in s, the Left() function would get -1 as the second argument, which may cause some problems, I guess. I'll have to Replace() the comma with nothing.Thanks for your response, Blue. I don't know why it works for you, maybe version differences. I'm not sure how to get the version number for my IIS server, but the under the Default Website Properties, on the Server Extensions tab, I see version 4.0.2.6513. Link to comment Share on other sites More sharing options...
Webworldx Posted October 13, 2005 Share Posted October 13, 2005 Ahh yes, checking for the comma would be necessary.. I just assumed (naively) that all inputs would have it Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now