question: MoveToRecord() use with table type ?

question: MoveToRecord() use with table type ?

Post by Kevin Ha » Fri, 09 Sep 1994 05:41:54



        I am working on a form which displays a limited amount of data from a
Paradox 4.5 for Windows table.  A button option is used to display more  
information associated with the current record.  I am calling a second  
form from the button and would like to display the corresponding data.  
        Is it possible to get the record number corresponding to the
current cursor position  and display the record.
        Any pointers would be appreciated.
        please respond by email!!!
                                -thanks for your help
                                Kevin

--
/*--------------------------------------------------------------------------*/
                              Kevin D. Hall    

  Computer Science                              

 
 
 

question: MoveToRecord() use with table type ?

Post by Joseph Everett Bentl » Fri, 09 Sep 1994 15:31:52



>        I am working on a form which displays a limited amount of data from a
>Paradox 4.5 for Windows table.  A button option is used to display more  
>information associated with the current record.  I am calling a second  
>form from the button and would like to display the corresponding data.  
>        Is it possible to get the record number corresponding to the
>current cursor position  and display the record.
>        Any pointers would be appreciated.
>        please respond by email!!!
>                                -thanks for your help
>                                Kevin
>--
>/*--------------------------------------------------------------------------*/
>                          Kevin D. Hall    

>  Computer Science                              

There are lots of ways to do this this so here's one way:

If you have a record 'MyRec', you could attach a TCursor to it, to hold your
position and then use a UIObject.moveToRecord(TCursor) to align the record
on the second field to the corresponding cursor position.

Sample Code:

method pushButton(var eventInfo Event)
var
  f2 Form
  tc TCursor
endVar

  tc.attach(MyRec)     ; Attach a temporary cusor to save your place

  f2.open("FORMTWO.FSL",WinStyleHidden)

  f2.OtherRec.moveToRecord(tc)   ; Align the other record on the second
                                 ; to the temporary cursor position

  f2.wait()
  f2.close()

endmethod

GoodLuck!

-joe

--

||   || ||\/|| ||=||   |||     Phone : (408) 425-7455
!!!! !! !!  !! !! !! !!   !!   Fax   : (408) 425-7516


 
 
 

question: MoveToRecord() use with table type ?

Post by Kuo-Sheng (Kas » Sun, 11 Sep 1994 03:08:42


:         I am working on a form which displays a limited amount of data from a
: Paradox 4.5 for Windows table.  A button option is used to display more  
: information associated with the current record.  I am calling a second  
: form from the button and would like to display the corresponding data.  
:         Is it possible to get the record number corresponding to the
: current cursor position  and display the record.

Two options:

1) use a LOCATE and fine the value in the calling form.  If the CALLED
form is a dialog box and wait()/formreturn is used, you can do the locate
before the wait()

2) you can use the nrecords() and currecord() fucntions to get the record
number.

I recommend 1 since you have to take into account possibility of the
record number changing WHILE the database is being used (multi-user
environment), even if you have only one user now.  (Good habit).

--
==============================================================================

||   (the rest of this .sig is under construction...)                       ||
==============================================================================