Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CASL Macro Help 2

Status
Not open for further replies.

rlpenman1

Programmer
Jan 29, 2004
10
US
I am working with InfoConnect Version 5 it does not contain the Extra basic language it only has the CASL Macro built in I have no choice but to use this software. Is there anyone who is using this program that can help? If so I need to know how to get selected data from the host screen and place it in a string in side one of my Macros. The only way I have been able to do this now is by printing the screen to a txt file. Then trying to sort though the entire data in the txt file just to get the little bit of information I need from this screen. Any help with the CASL Macro's would be great.
 
you might try instr(yourstring,"what your looking for") or I could post a really cool copy of hunt for :) LOL
 
winstring (function)
Use winstring to return a string read from a session window.

Format
x$ = winstring(row, col, len)

Comments
winstring reads a string of characters from the session window, beginning at row, col, for len characters, with any trailing spaces removed.

winstring lets you determine the results of operations not under macro control, such as the appearance of a certain string at a certain location on the screen while under the control of a host.

Example
Code:
string data
data = winstring(10, 10, 11)
if data = "Login name:" then reply userid

In this example, if the phrase Login name: appears in the session window beginning at row 10, column 10, then the userid system variable is sent to the host.


You should have a CASL PDF file on your computer that will give you a list of the functions. If not, I think you can find the PDF at the Attachmate site.
 
Star for Skie.

In Jan of 04 Rlpenman1 along with myself were tasked with writing macros in the wonderful language of CASL. I had responded to his meesage over a year later just to poke fun at him as we now have a much greater understanding of the functions (or lack of) in CASL. Here is the huntfor script that we had wrote to look for items on the screen that changed locations if anyones interested.

func HuntFor(FindMe) returns string
integer row,column
for row = 1 to 24
for column = 1 to 80
if column+len(findme)<82 then
{
if winstring(row,column,len(FindMe)) = FindMe then return str(row)+","+str(column)
}
next column
next row
return "Not Found"
endfunc

This worked great with a turnpage function to locate text we were looking for, that is until we found the instr function.

for row = 1 to 24
if instr(winstring(row,1,80,"Find this text")> 0 then
{
found our text and row + instr tells us where it's at
}
next

of course all this is nill since we switched to the RealBasic language.

thanks again Skie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top