Display a SAY from within a GET.

Display a SAY from within a GET.

Postby HunterEC » Tue Sep 14, 2010 4: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: Select all  Expand view  RUN

@ 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.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Display a SAY from within a GET.

Postby nageswaragunupudi » Tue Sep 14, 2010 4:26 pm

Assuming that the field name of Customer Name in the DBF is CUSTNAME:
Code: Select all  Expand view  RUN
@ 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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Display a SAY from within a GET.

Postby Marcelo Via Giglio » Tue Sep 14, 2010 4:27 pm

Hola,

try this
Code: Select all  Expand view  RUN
@ 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
Marcelo Via Giglio
 
Posts: 1065
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: Display a SAY from within a GET.

Postby James Bott » Thu Sep 16, 2010 4: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 48 guests