Joe Strazzere - All Things Quality

June 24, 2009 - WinTask - CleanString$

Posted in WinTask

 

 

'
' CleanString$ - replace all occurences of < and > in a string,
'                with < Lower> and < Greater> respectively
'                so it can be safely used with SendKeys()
'
' Author - Joe Strazzere
'

 

Function CleanString$(StringIn$)
    StringIn$=Replace$(StringIn$,"<","{{lt}}")
    StringIn$=Replace$(StringIn$,">","< Greater>")
    StringIn$=Replace$(StringIn$,"{{lt}}","< Lower>")
    CleanString$ = StringIn$
EndFunction

 

'
' For example
'
KeyString$="a < b and b > c"

 

UseWindow("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1)
    SendKeys(CleanString$(KeyString$))



Any comments on this article?
Email Me


<- Last Page :: Next Page ->

About Me

A gathering place for information and ideas about Quality Assurance, Testing, and other useful topics.

Problems cannot be solved by the same level of thinking that created them. - A. Einstein

Search This Site

Translate This Site

RSS Feed

Subscribe

Twitter

@jstrazzere

Categories

Life
QA
Sports
Tools
WinTask
Work in General

What I'm Reading Now