Display a SAY from within a GET.

Post Reply
HunterEC
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Display a SAY from within a GET.

Post by HunterEC »

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


@ 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.
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Display a SAY from within a GET.

Post by nageswaragunupudi »

Assuming that the field name of Customer Name in the DBF is CUSTNAME:

Code: Select all | Expand

@ 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
Marcelo Via Giglio
Posts: 1073
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia
Has thanked: 1 time

Re: Display a SAY from within a GET.

Post by Marcelo Via Giglio »

Hola,

try this

Code: Select all | Expand

@ 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
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Display a SAY from within a GET.

Post by James Bott »

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
Post Reply