smus Posted September 10, 2018 Share Posted September 10, 2018 How do we check if a given string is empty or not? I've tried isNull, isEmpty as well as equal and non-equal signs, the results are the same for empty and filled texts. My code looks like this: Call am(es) Call am(fs) es = "" fs = "ms" Sub am(s) if s <> "" then response.write "The string is not empty <br>" else response.write "The string is empty <br>" end if end Sub Link to comment Share on other sites More sharing options...
justsomeguy Posted September 10, 2018 Share Posted September 10, 2018 That looks fine but you should probably declare your variables before you try to use them. 1 Link to comment Share on other sites More sharing options...
smus Posted September 12, 2018 Author Share Posted September 12, 2018 On 9/10/2018 at 11:30 PM, justsomeguy said: That looks fine but you should probably declare your variables before you try to use them. Added Dim es, fs but the result is the same. "The string is empty" for both cases Link to comment Share on other sites More sharing options...
Ingolme Posted September 12, 2018 Share Posted September 12, 2018 You're calling the subroutine passing in variables that have not been initialized. Initialize the variables first, then call the subroutine. 1 Link to comment Share on other sites More sharing options...
smus Posted September 12, 2018 Author Share Posted September 12, 2018 3 minutes ago, Ingolme said: You're calling the subroutine passing in variables that have not been initialized. Initialize the variables first, then call the subroutine. Right, thanks 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