1) varread() o anda uzerinde oldugunuz kolonun (browse, grid icin ya da herhangi bir kontrol) alan adini veriyor (grid.column.Controlsource gibi). VFP help, ne yazik ki, geriye uyumluluk sinifina sokuyor ve yerine Controlsource, Name property kullanin diyor. Oysa, bu VFP'nin geride biraksa da, yerini dolduramadigi birkac fonksiyondan birisi. Onun yerine simdi hicbir sey gecemiyor.
Customers tablosu gridde ise ve o sirada 2.kolondaysaniz, varread() 'Company' dondurur. Dogru bu controlsource'da var, ama oraya varread() gibi ulasmanin basit bir yolu yok (hittest ile kolonu bul, conrolsource'unu al uzun is).
2) Debug edebilmek icin, "kodu secip, sag klik, execute selection" yerine kodu bir prg dosyasina kaydet ve oradan calistir.
******************************************
Foxpro 2.6a help dosyasindan:
+---------------------------------+
¦ VARREAD() ¦
+---------------------------------+
VARREAD()
-----------------------------------
Returns in uppercase the name of the memory variable, array element, or field used to create the current @ ... GET field or control.
Return value - Character
-----------------------------------
Controls include check boxes, fields, invisible, push or radio buttons, lists, popups, spinners, and text-editing regions.
If a Browse, Change or Edit window is active, the name of the current field is returned with the first letter of the field name capitalized.
VARREAD() is identical to SYS(18). Both can be used to pass the current field or control name to a procedure that in turn can provide context-sensitive help, as in the following example.
+---------------------------------+
¦ Example ¦
+---------------------------------+
SET TALK OFF
CLOSE DATABASES
ON KEY LABEL F1 DO Help WITH VARREAD()
USE customer
SCATTER TO temp
DEFINE WINDOW input FROM 6,10 to 18,70 PANEL
ACTIVATE WINDOW input
@ 1,3 SAY 'Customer: ' GET company
@ 3,3 SAY 'Address: ' GET address
@ 5,3 SAY 'City: ' GET city
@ 7,3 SAY 'State: ' GET state
@ 7,18 SAY 'Zip: ' GET zip
@ 9,7 SAY 'Press <Esc> to cancel or <F1> for help'
READ
GATHER FROM temp
DEACTIVATE WINDOW input
RELEASE WINDOW input
ON KEY LABEL F1
RETURN
*** Help Procedure ***
PROCEDURE Help
PARAMETERS fieldname
DO CASE
CASE fieldname = 'COMPANY'
WAIT WINDOW 'Enter the company name' NOWAIT
CASE fieldname = 'ADDRESS'
WAIT WINDOW 'Enter the street address' NOWAIT
CASE fieldname = 'CITY'
WAIT WINDOW 'Enter the city name' NOWAIT
CASE fieldname = 'STATE'
WAIT WINDOW 'Enter a two-character state abbreviation' NOWAIT
CASE fieldname = 'ZIP'
WAIT WINDOW 'Enter the five-digit Zip code' NOWAIT
ENDCASE
RETURN
-----------------------------------
Son düzenleyen, cetinbasoz (17.12.2009 14:59:38)
Yen yaz 1907'ye yolla FB gelsin evinde yensin