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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating CASL MACRO

Status
Not open for further replies.

squezz

Programmer
Oct 4, 2006
3
IT
Sorry, I am a newbye in CASL in Attachmate 5.0 and, naturally, I need help.

I should create a CASL which:
1.make a query for each day for each number flight (dpe ....)
2.if the reply is NO-OP the CASL continue with the following flight
3.if the reply is not NO-OP it send another command collecting the analyze of flight
4.for each reply the CASL must save data localy

For the first three steps I could find a solution (I have big experience in C and in scripting language), but how I could save data?

Help me

Squezz
 
1.make a query for each day for each number flight (dpe ....)
what commands are you doing to make the query?
2.if the reply is NO-OP the CASL continue with the following flight
What does a NO-OP reply look like on the screen?
3.if the reply is not NO-OP it send another command collecting the analyze of flight
what does this look lie on the screen?
4.for each reply the CASL must save data localy
Save data locally??? .txt .xls where?

Post the code you've got thus far and we'll see what we can do to help.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
(I have big experience in C and in scripting language)
What scripting language? Would you prefer to do this in VBA?

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
I have CASL Editor integrated in Attachmate, I prefer CASL Editor. It make files with xws extension and it could compile the xws files in xwc.

For the query I use:

dpe 0D152/01nov

where 0d152 is the number of the flight and 01nov is the day.

For no operating I receive "NO-OP?" below on the screen.

The second command is (for example):

RI 0D152/01nov L
ID 0D152/01nov

which displays the detail.

I need to save data in txt format at least.

Regards
 
Code:
string  sLine, sFileSpec
integer iCurrentRow

sFileSpec = "C:\SomeFolder\SomeName.txt"  --file to write

Open Output sFileSpec as #1               --Opens text file for writing

for iCurrentRow= 1 to 24                  --loop through 24 screen rows
  sLine = winstring(iCurrentRow,1,80)     --Scrape screen row to variable
  write line #1,sline                     --Writes line to text file
next iCurrentRow

close #1 --close textfile

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Code:
Reply "<CLEARPAGECURSORHOME><CLEARPAGEANDFCCS>"  --Clear the screen
? at 1,1 "dpe 0D152/01nov";  --text to row 1 column 1 of screen
Reply "<TRANSMIT>"  --Send query

wait 10 seconds for "NO-OP?","Other Scenario" : 
--  will wait up to ten seconds for system response
--  add a secondary watch to avoid waiting the full 10 seconds
--  it will jump out of the wait as soon as either condition is met

if timeout then alert "Timeout",ok:end  -- neither expected response in ten seconds

case match of
  "NO-OP?":         continue with the following flight
  "Other Scenario": send another command collecting the analyze of flight
endcase

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Thanks a lot :)

It's a good start

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top