×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

read cointuous rows write into screen
2

read cointuous rows write into screen

read cointuous rows write into screen

(OP)
I am trying to do read from excel sheet2 column b and row 8 wrtie to the screen position in 45,52
How do identity that is in row 8 and till end
Putstring in screen do something and go back again read next row and putstring in screen till endth row
I could not figure it out. Could you please help me
 

RE: read cointuous rows write into screen

Search this forum for 'Excel' and you'll find many examples. Put an attempt together and we'll help you work out the problems. Let us know what language you plan on writing in. If your just reading from Excel you could be okay using Extra for anything more I'd recomend using VBA.

Sometimes you gotta leave your zone of safety. You have to manufacture Inspirado. You gotta get out of the apartment. You've got to run with the wolves. You've got to dive into the ocean and fight with the sharks. Or just treat yourself to a delicious hot fudge sundae........ with nuts. - Jack Black

RE: read cointuous rows write into screen

(OP)
vzachin
thanks for your comment. i did some point
here is part of the code
could yuo help me

last_row2 = xl_sheet_2.Range("B2").CurrentRegion.Rows.Count

   next_row = xl_sheet_2.Range("B2").CurrentRegion.Rows.Count + 1

   For k = 2 To last_row2
   x = Trim(xl_sheet_2.range("Bk")  ' syntax error

      MyScreen.PutString x,8,13

 Next

 

RE: read cointuous rows write into screen

buddha88,

in order for us to help you, you need to provide more details...

IknowMe said:

Quote:

Let us know what language you plan on writing in
...
are you writing this in excel or attachmate?

in your latest post

CODE

x = Trim(xl_sheet_2.range("Bk")  ' syntax error
what is .range("Bk") ? is that column BK? if that is, then you need a row to go with that...

did you at least try the code i posted?
 

RE: read cointuous rows write into screen

(OP)
vzchin
thanks this is my code here:
after this
MyScreen.PutString ("SM"),6,48
after press enter
after that sercH 'MARKED"- YES"
write into column f and go back to next row in column b and
repeat do---- loop
i am struggling here becasue the marked is not in first page
it come in 4th page or some where in middle i could not write in column f
could you help me in this regards
thanks guys really great!
the below code shows: here

j = 2
   Last_row2 = xl_sheet_2.Range("B1").CurrentRegion.Rows.Count
msgbox(last_row2)
  ' next_row = xl_sheet_2.Range("B1").CurrentRegion.Rows.Count + 1
'msgbox(next_row)
   For k = 2 To last_row2
   
  do
   x = Trim(xl_sheet_2.Cells(k, "B").Value)

   
   MyScreen.PutString x, 5,27

     MyScreen.SENDKEYS("<Enter>")
     iwait
MyScreen.PutString ("SM"),6,48
   MyScreen.SENDKEYS("<Enter>")

IF MyScreen.find ("MARKED:") then
   DONT KNOW WHAT I HAVE WRITTEN HERE
end if
      
 Loop Until  xl_sheet_2.Cells(k, "B").Value <> ""  
   Next
 
end with
 

RE: read cointuous rows write into screen

you still didn't say if you are using Extra basic or Excel VBA.

try this code out

CODE

Sub Main()
Dim Sys As Object, Sess As Object, MyScreen As Object, MyArea As Object
Set Sys = CreateObject("EXTRA.System")
Set Sess = Sys.ActiveSession
Dim obj as object
Dim objWorkbook as object
Set obj=CreateObject("Excel.Application")

Set obj = Getobject("C:\test.xls")    'i used this to test the code   
set objWorkbook=obj.Worksheets("bud")   'with this worksheet


For i = 2 To obj.ActiveSheet.Rows.Count  
xlData = trim(objWorkBook.Range("B" & i))      

if xlData = "" Then exit For

    Set MyScreen = Sess.Screen
        MyScreen.PutString xlData,5,27  'this places the data from Excel
        MyScreen.SendKeys ("<Enter>")
        'consider pausing here to give a chance for system response
        MyScreen.WaitHostQuiet (100)
        MyScreen.PutString "SM", 6,48  'your code had ("SM"), this is wrong

        MyScreen.SendKeys ("<Enter>")
        'consider pausing here to give a chance for system response
        MyScreen.WaitHostQuiet (100)
        
        'the following code below
        'moves the cursor to row 1 column one
        'and then searches for the word MARKED
        'if the word is found, the cursor is moved to
        'where the word MARKED was found
        'a comparison is made where the cursor is found
        'if the cursor is still on row
        'if it's not found, then go to next page
        'and continue until the word is found
        
        Do
         
    MyScreen.MoveTo 1, 1

    Set MyArea = MyScreen.Search("MARKED")
        MyScreen.MoveTo MyArea.Bottom, MyArea.Left
        MyRw = MyScreen.Row

        If MyRw = 1 Then
        MyScreen.SendKeys ("<Enter>")  'dunno how you go to next page    
                                        'change accordingly
        Else
        'this means MARKED was found because the cursor was moved
        'from 1,1
        'the following will place the word "YES"
        'in column F same row as B
        objWorkBook.Range("F" & i) = "YES"
        
        exit do  'this will now loop to next entry in Excel Sheet Col B
        end if
        
        Loop  
        'CAUTION:
        'need to exit Loop if MARKED is not found
        'how many pages are there? or will MARKED always be found?
        'if there are only 6 pages, then add a counter for each loop
        
        
next i    
 
End Sub

hth

RE: read cointuous rows write into screen

(OP)
vschin
thanks a lot, i will try it on monday and let you know
but there is no page limit may be 2nd page or may 4 or 6.
so can i do untill if Myscreen, search (""marked:  ") then
What is this code for if it is not found in first page market instead of enter f8 go to next page
  MyScreen.MoveTo MyArea.Bottom, MyArea.Left
        MyRw = MyScreen.Row

        If MyRw = 1 Then 'why this is 1,
thanks a lot, learnt from you, great!!. thanks a lot .
one more is it possible can i generate standard email .
i am writing macro in Extra!.
standard email with different user



 

RE: read cointuous rows write into screen

Quote:

but there is no page limit
i find this rather hard to believe. what will happen if "marked:  " is not found? will you page advance until infinity and beyond? that would be programming suicide. you need to think this over carefully...

Quote:

If MyRw = 1 Then 'why this is 1

if you look carefully at the code, i added this right after Do

CODE

MyScreen.MoveTo 1, 1
this means move the cursor to row 1, column 1.
then it proceeds to "search" for your qualifier "marked". if it finds this qualifier, move the cursor to the where the word marked begins

CODE

MyScreen.MoveTo MyArea.Bottom, MyArea.Left
. my assumption is that it won't be on row 1. i added

CODE

MyRw = MyScreen.Row
to show where the row is after the search. so if MyRw = 1 (remember i moved the cursor to row 1 when i first started) that means "marked" was not found. otherwise it would be in another row, (unless it can be on row 1, then we can adjust to code to also look at the column). if MyRw = 1,that means you need to go to the next page and continue searching (this is where you need to place your code to page advance. i don't know what your page advance key is so i put in <enter>if it is P8, then code it accordingly). then again, it moves the cursor back to row 1, column 1. this will continue until the search is successful. if the  search is successful, that's where the ELSE statement is used. if it's successful, then write the data back to Excel. My assumption was you wanted the literal "YES" written back to Excel and that's what i provided.

you need to step through the code and figure out on your own what the code is doing or not doing. this is the *best* way to learn.

and sorry, i don't know how to handle email. maybe someone else can help you with that in your other post

RE: read cointuous rows write into screen

(OP)
thank you so much vzchin. i understood fully what you said explain in detailed. thanks a lot. i will step through the code.
 

RE: read cointuous rows write into screen

(OP)
it works great!!! thanks for your valuable hint

RE: read cointuous rows write into screen

Quote (buddha88):

it works great!!! thanks for your valuable hint  

You really ought to...

Thank vzachin
for this valuable post!
.

The little purple Stars accomplish several important things.  

First, it gives positive feedback to contributors, that their posts have been helpful.  

Second, it identifies threads as containing helpful posts, so that other members can benefit.

And third, it identifies the original poster (that's YOU, BTW), as a grateful member, that not only receives, but is willing to give tokens of thanks.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close