Questions!
Questions!
(OP)
Hello,
Not sure if it's a norm to create different threads for different questions but thought I would consolidate my queries under this thread.
Q1. WaitForCursor
would like to check for this 2 codes below
and
So far I could only make the first code with <Enter> works but not the code with <Tab>, it will always overshot the coordinates I specify, may I know what could be the cause?
Q2. <Tab>-ing
Is there another method to specify the cursor to move to a desired coordinates besides using <Tab>? As I need the cursor to always go to the same field in any different scenario. I have tried MoveTo and it won't work (unless there's a certain setting which I am missing).
Thanks in advance!
Br
kzhkr
Not sure if it's a norm to create different threads for different questions but thought I would consolidate my queries under this thread.
Q1. WaitForCursor
would like to check for this 2 codes below
CODE -->
Sess0.Screen.SendKeys ("<Enter>") Do Until Sess0.Screen.WaitForCursor(23, 9) Sess0.Screen.SendKeys ("<Enter>") Loop
CODE -->
Sess0.Screen.SendKeys ("<Tab>") Do Until Sess0.Screen.WaitForCursor(23, 9) Sess0.Screen.SendKeys ("<Tab>") Loop
So far I could only make the first code with <Enter> works but not the code with <Tab>, it will always overshot the coordinates I specify, may I know what could be the cause?
Q2. <Tab>-ing
Is there another method to specify the cursor to move to a desired coordinates besides using <Tab>? As I need the cursor to always go to the same field in any different scenario. I have tried MoveTo and it won't work (unless there's a certain setting which I am missing).
Thanks in advance!
Br
kzhkr
RE: Questions!
This is an asynchronous process. You must SEND a command to a remote computer and you must determine when the remote computer has completed its process. Using WaitForCursor is one way to determine if the remote computer is done. After sending the command ONE TIME, your code must WAIT in a loop until the cursor reappears at the screen rest coordinates. At that time the WaitForCursor expression becomes TRUE.
Assuming that the screen rest coordinates are 23, 9:
CODE
http://docs.attachmate.com/reflection/14.x/prog-re...
Skip,
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
And MoveTo does not work on my EXTRA! attachmate, is there alternative method to tab to specific coordinates if WaitForCursor does not work with <tab>?
Thanks
kzhkr
RE: Questions!
Every point (row, column coordinate) is at your command by either GetString, PutString or Area. Back ten years ago when I was doing this regularly, I’d grab the entire screen from 1,1 to 24,80 using Area and assign every field to an array variable and write that array to a table in Excel that described the entire screen.
Never ever TABBED via code! Don't need to! You can grab a single piece of data off each screen, all data or anything in between.
Check out FAQ99-7950: Strategies for scraping in multiple screens.
BTW, if you were to TAB to a cell, that in only one third of the data you need to grab data. You need the LENGTH of the field and the TYPE of data (character or number). The FAQ I posted gives you a suggestion about that.
Skip,
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
The tabbings are for me to input data into the fields
and will execute the codes in Attachmate itself.
Thanks
kzhkr
RE: Questions!
Use PutString
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
RE: Questions!
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
CODE -->
This is my current working code. If I replace Sess0.Screen.SendKeys ("HK" & mtrnID) with Sess0.Screen.PutString ("HK" & mtrnID), 4, 5 and removing the line before this, it won't work.
RE: Questions!
CODE
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
RE: Questions!
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
Sorry, I have to blank out some details.
The error is only "syntax error"
RE: Questions!
CODE
After each SendKeys that kicks off the mainframe, you must have a WaitFor??? Loop!
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
F13 is a command for clearing field so I think it's unavoidable and F13 should be instantaneous.
So... correct me if I'm wrong. I can actually use PutString without doing any tabbing in the screen?
RE: Questions!
http://docs.attachmate.com/extra/x-treme/apis/com/...
FYI, any Key sequence that causes the mainframe to process requires a WAIT until the asynchronous process completes.
If the Key sequence merely manipulates the screen, like TAB or CLEAR, no WAIT is required.
Skip,
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
And tried using the code in the example you linked, it will only PutString "Hello" on the line my cursor is.
It won't specifically go to the coordinates I assigned.
RE: Questions!
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
Is there any setting to disable/enable for the string to be place anywhere in the screen and not based on where the cursor is?
RE: Questions!
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
The beetle will be removed if I put it as Sess0.Screen.PutString ("HK" & mtrnID), 4, 5
and yup, it will load that field where the cursor is.
RE: Questions!
BTW, I see no code to instantiate a SYSTEM object or a SESSION object.
???
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
CODE -->
See if you can spot where's causing the problem. Thanks!
RE: Questions!
CODE
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
RE: Questions!
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
RE: Questions!
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
RE: Questions!
How do I read external files? (Eg. txt file)
sample 1
to scan sample 1 2nd column data downwards with a variable to match string
sample 2
if found matching string.. in sample 2, copy the string after delimiter ':'
and put into a variable
can it be done?
BR
kzhkr
RE: Questions!
Consequently, your text file would simply be IMPORTED into an Excel sheet via Data > Get external data... where it would be parsed into columns using a specified delimiter.
Then it’s merely looping through the desired column...
CODE
Of course you could Open the text file, loop thru it and grab the part of the text string that you want in Extra!VB. To me, that would be an unwanted chore.
Things are a LOT easier to do in Excel VBA! The editor has many features that can help you.
What do you intend to do with the data from these two text files?
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
Will there by any speed difference when accessing excel or text file? If not I also believe excel will be a better choice in organizing the list.
will be doing string comparison in SEBIS with the file sample 1, if found matching string will go ahead to open file sample 2 to look for same name and copy the string beside the matched name back into SEBIS.
Br
kzhkr
RE: Questions!
Skip,
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
Okay..
I can't show you what's on my attachmate screen due to sensitive information.
1. I will key in a "Register number" to process the entry.
2. After which I will cross reference Field 52 (11, 62) (Eg. BOFUSESS) with sample 1 database.
2a. If YES, proceed with cross referencing with sample 2 database and find correspondent partner which is after the delimiter ":". (Eg. BOFUSESS:ABCDHKHH)
2b. If NO, proceed with processing.
3. Copy ABCDHKHH and paste into Attachmate screen Field 53 (14, 66).
That will be the manual processing steps I will do.
Hope it helps, thank you!
Regards,
kzhkr
RE: Questions!
“After which I will cross reference Field 52 (11, 62) (Eg. BOFUSESS) with sample 1 database.”
Couldn’t that a lookup in Excel?
Skip,
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
So looking at using text file as alternative.
Now waiting for the files to be sent to me for trying..
:D
RE: Questions!
Do you not have Excel on your PC?
Skip,
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
RE: Questions!
Was advised by my IT dept to run the macro via Attachmate instead.
So..... can I check how do I open the excel/text file for referencing via Attachmate?
RE: Questions!
Regarding the question of reading text files, you just open using native VB. In a loop you read or input one record at a time, inspect it, do something or not and on the the next.
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein