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!

how do write this code

Status
Not open for further replies.

shawwallace

Technical User
Feb 9, 2008
19
CA
from vt session i have some records showing in that, i have to grab the thing and print or if it is no records found that also print
how do write the bothe in one.
the below code could anybody modify this
thansk in advance


MyScreen.SENDKEYS "<Home>*<EraseEOF><Tab>UT<Enter>")
MyScreen.WAITFORSTRING("ACCOUNTS")
For i = 6 to 21
Print #1, MyScreen.Area(i,2,i,79);
PRINT #1, ""+Chr$(13) + Chr$(10)+"";
Next

IF InStr(1,UCASE(Myscreen.GETSTRING(24,2,5,)),"NO RECORD/S FOUND") THEN

Print #1, "NO RECORDS FOUND" +Chr$(13) + Chr$(10)+"";



 



Print?

Print # is the syntax for writing to a file.

Confused about what you are trying to do.

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Skip
thanks for your help. waht i am trying to do
from vt session if the datas are there it print out otherwise it will print no records found
the above code two separate statements/
 



Print WHERE? To a file? Do you have Open and Close statements?

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
skip sorry i forgot to tell you. i ahve open and close stattments which has open a text file and close text file
 



Don't you thin that you should do this...
Code:
IF InStr(1,UCASE(Myscreen.GETSTRING(24,2,5,)),"NO RECORD/S FOUND") THEN
before you open the file?

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
In that case if i wait for string "acctonts"
how do save it without open the text file.
please explain in detail regard this
thanks
 



OK you want to write to the file in EITHER case.

So you test for no records before looping.

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
yes skip if if it is no record found it writes into text file as no records found
is it right
MyScreen.SENDKEYS "<Home>*<EraseEOF><Tab>UT<Enter>")
MyScreen.WAITFORSTRING("ACCOUNTS")
if IF InStr(1,UCASE(Myscreen.GETSTRING(24,2,5,)),"NO RECORD/S FOUND") THEN
Print #1, "NO RECORDS FOUND" +Chr$(13) + Chr$(10)+"";
Else

For i = 6 to 21
Print #1, MyScreen.Area(i,2,i,79);
PRINT #1, ""+Chr$(13) + Chr$(10)+"";
Next
End if

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top