Announcement

Collapse
No announcement yet.

Replace all numbers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rupp
    replied
    Originally posted by rmasonjr View Post
    you need to dim callerid2 as an array - you're referencing it as an array, but it is a string.
    Whoops, I did this in vb.net and took off the datatype. Sorry.

    Leave a comment:


  • Gogs
    replied
    You could also have a read here.

    Leave a comment:


  • Skibum
    replied
    I got it... thanks for all of your help.

    Leave a comment:


  • rmasonjr
    replied
    Originally posted by Rupp View Post
    Dim i
    Dim callerId2
    callerId2 = "a23 v55-1212"
    For i = 0 To Len(callerId2)
    If IsNumeric(callerId2(i)) Then
    ' This is a number speak an alternate phrase
    MsgBox("This is a number")
    End If
    Next
    you need to dim callerid2 as an array - you're referencing it as an array, but it is a string.

    Leave a comment:


  • Skibum
    replied
    If I replace the msgbox with a hs.speak, it speaks for each digit found in the string..

    Suggestions?

    Leave a comment:


  • Skibum
    replied
    I'll see if I can figure that out.. Thanks!

    Leave a comment:


  • Rupp
    replied
    Dim i
    Dim callerId2
    callerId2 = "a23 v55-1212"
    For i = 0 To Len(callerId2)
    If IsNumeric(callerId2(i)) Then
    ' This is a number speak an alternate phrase
    MsgBox("This is a number")
    End If
    Next

    Leave a comment:


  • Skibum
    replied
    The device string in question would be a phone number...

    Typically xxxxxxxxxx or xxxxxxxxxxx

    I just want to convert to a given string is there are ANY numbers present.

    Dim callerId2 as String is the string is question.

    Leave a comment:


  • Rupp
    replied
    Post me an example device string and I'll work it up.

    Leave a comment:


  • Skibum
    replied
    I'm there... but not smart enough to apply that to a device string.

    Leave a comment:


  • Rupp
    replied
    Check out the isNumeric call. You could loop through the characters and if any of them are isNumeric then announce your phrase.

    Leave a comment:


  • Skibum
    started a topic Replace all numbers

    Replace all numbers

    I currently have Homeseer announcing caller ID by name or by phonebook entry. Sometimes calls come in with the caller ID being the phone number. I'd like a script to replace any phone number that might appear in the device string with a single entry like: "No advanced Caller ID information"

    I cant figure out how to do a replace that would cover any number and change it to a single phrase.

    Any help?

    Thanks
Working...
X