FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Display a SAY from within a GET.
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Display a SAY from within a GET.
Posted: Tue Sep 14, 2010 04:19 PM
Guys:

After GETting the field nNumber, how can I display the customer name from the database from within the GET at position 25,40 ?

Code (fw): Select all Collapse
@ 10,05 SAY oSays[1] VAR "Number"        OF oDlg PIXEL
@ 25,05 SAY oSays[2] VAR "Name"           OF oDlg PIXEL
@ 25,40 SAY oSays[3] VAR Cust_name     OF oDlg PIXEL
@ 40,05 SAY oSays[4] VAR "Balance"        OF oDlg PIXEL
@ 55,05 SAY oSays[5] VAR "Date"            OF oDlg PIXEL

@ 10,40 SAY oGets[1] VAR nNumber        OF oDlg PIXEL
             VALID IIF(DBSEEK(nNumber, .F.), ..., MsgALert("Customer Not Found"))
@ 40,40 SAY oGets[2] VAR nBalance        OF oDlg PIXEL


Thank you.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Display a SAY from within a GET.
Posted: Tue Sep 14, 2010 04:26 PM
Assuming that the field name of Customer Name in the DBF is CUSTNAME:
Code (fw): Select all Collapse
@ 10,05 SAY oSays[1] VAR "Number"        OF oDlg PIXEL
@ 25,05 SAY oSays[2] VAR "Name"           OF oDlg PIXEL
@ 25,40 SAY oSays[3] VAR FIELD->CUSTNAME     OF oDlg PIXEL UPDATE
@ 40,05 SAY oSays[4] VAR "Balance"        OF oDlg PIXEL
@ 55,05 SAY oSays[5] VAR "Date"            OF oDlg PIXEL

@ 10,40 SAY oGets[1] VAR nNumber        OF oDlg PIXEL
             VALID IIF(DBSEEK(nNumber, .F.), ;
                            (oDlg:Update(), .t. ), ;
                            (MsgALert("Customer Not Found"), oDlg:Update(), .f. ))
@ 40,40 SAY oGets[2] VAR nBalance        OF oDlg PIXEL
Regards



G. N. Rao.

Hyderabad, India
Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM
Re: Display a SAY from within a GET.
Posted: Tue Sep 14, 2010 04:27 PM
Hola,

try this
Code (fw): Select all Collapse
@ 10,05 SAY oSays[1] VAR "Number"        OF oDlg PIXEL
@ 25,05 SAY oSays[2] VAR "Name"           OF oDlg PIXEL
@ 25,40 SAY oSays[3] VAR Cust_name     OF oDlg PIXEL
@ 40,05 SAY oSays[4] VAR "Balance"        OF oDlg PIXEL
@ 55,05 SAY oSays[5] VAR "Date"            OF oDlg PIXEL

@ 10,40 SAY oGets[1] VAR nNumber        OF oDlg PIXEL
             VALID IIF(DBSEEK(nNumber, .F.), ( oSays[3]:setText( cust_name ), oSay[3]:refresh() ) , MsgALert("Customer Not Found"))
@ 40,40 SAY oGets[2] VAR nBalance        OF oDlg PIXEL
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Display a SAY from within a GET.
Posted: Thu Sep 16, 2010 04:59 PM

I am assuming this var is an array: oSays[1]

This is not really correct Hungarian syntax. An array datatype should be prefixed with an "a" regardless of what datatype the array contains (in this case an object). So it should be aSays instead. It does contain oSay objects.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion