I am looking to construct a dynamic string, for instance
I will be assigning a new value to the variable keyword and then invoke the script. If the keyword does not return search results, my application gives the message:No matches found for search text 'x'
Say keyword=x
No matches were found for search text 'x'
In order to compare the string, I declare a variable containing this keyword
Let>NoSearchResults=No matches were found for search text '%keyword%'. How do i construct this variable to hold the keyword value I am passing?
TIA.
Constructing dynamic strings
Moderators: Dorian (MJT support), JRL
Thanks for your reply. I am trying to do the following. I am passing a keyword as input to a search window in my application. If the keyword does not return any results, then I will quit. Else I'll call another subroutine and continue.
Code Snippet is something like:
Let>Keyword=xim
GoSub>CallApplication
Send>keyword
//search is done using the keyword and if no search result, the text "No matches found for keyword '' " is returned. I capture the text in GetValue.
GetClipBoard>GetValue
if>GetValue=No matches found for search text '%keyword%' //My question is how do I pass the keyword in this string?
Exit application
else
Call another subroutine and continue.
endif
Code Snippet is something like:
Let>Keyword=xim
GoSub>CallApplication
Send>keyword
//search is done using the keyword and if no search result, the text "No matches found for keyword '' " is returned. I capture the text in GetValue.
GetClipBoard>GetValue
if>GetValue=No matches found for search text '%keyword%' //My question is how do I pass the keyword in this string?
Exit application
else
Call another subroutine and continue.
endif
If you want to know how to pass in variables to subroutines,
here is a quote from the help system on how to do that.
here is a quote from the help system on how to do that.
Gosub>Subroutine_Name[,value1[,value2[,...]]]
Branches to the specified subroutine (SRT). When that the subroutine returns, processing continues at the next line after the Gosub command.
Subroutines can be nested. Subroutines can be located anywhere within the script.
If values are passed on the Gosub line variables will be created to contain these values. The variables are named with the following format: SubroutineName_Var_1, Subroutine_Var_2, ... Subroutine_Var_n