String or Not?

Results 1 to 3 of 3

Thread: String or Not?

  1. #1
    Join Date
    Dec 1969

    Default String or Not?

    Hello all,<BR> How do we find out whether a particular variable is a String or not, for example to find out if a var is a number or not we use IsNumeric(var), but there is no such function for Strings, I tried to use the VarType but it did not work, can someone correct this or tell me whats the best way to determine a variable as a String:<BR><BR>If VarType(Trim(myVar)) = "String" Then<BR>......<BR><BR><BR>Thanks<BR>das<BR>

  2. #2
    Join Date
    Dec 1969

    Default TypeName, not VarType

    If you want to use VarType (which *is* more efficient), then use vbString, vbInteger, etc. See the docs for VarType:<BR> If VarType(myVar) = vbString Then<BR><BR>But do *NOT* use TRIM in there: The result of calling TRIM is *ALWAYS ALWAYS ALWAYS* a string. By definition. Read the docs for Trim, as well.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: String or Not?

    try TypeName()<BR><BR><BR><BR>j<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts