MasteringVFP/4/8
出自VFP Wiki
強大ç Filter
å¨æ©æÂÂç¡æ³Â使ç¨ SQL çÂÂæÂÂÃ¥ÂÂ,è¦Âå¦Âä½Â篩é¸è³ÂæÂÂå¢??éÂÂæÂÂÃ¥ÂÂå°±æ¯ç¨ Filter å¦... 說å° Filter, ä»ÂçÂÂæ·å²å¯æ¯å¾Âæ 习çÂÂå¢~å¨ dBase æÂÂ代就已ç¶ÂÃ¥ÂÂå¨äºÂ. è¨Âå® Filter çÂÂæ¹æ³Âå¾Âç°¡å®,å°±æ¯éÂÂ樣åÂÂ:
set filter to æ¬Âä½Â=å¼
èÂÂÃ¥ÂÂæ¶Âä¹ÂÃ¥ÂÂ樣çÂÂ容æÂÂ:
set filter to
å¨以åÂÂ,å·è¡Âå® set filter to 以å¾Â,æÂÂ好è¦Â移åÂÂä¸Âä¸Âç´ÂéÂÂ,è® Filter çÂÂæÂÂ,ä¾Â妠go top, æÂÂæ¯ go bottom...,å¦åÂÂä½ æÂÂå¯è½ç¼ç¾,Filter æ²ÂæÂÂçÂÂæÂÂ...
ä¸Âé¢æÂÂÃ¥ÂÂå°±èÂÂÃ¥ÂÂç°¡å®çÂÂä¾ÂÃ¥ÂÂ,éÂÂ裡æ¯æÂÂæÂÂæÂÂ客æ¶編èÂÂÃ¥ÂÂé¢çº "S01" çÂÂ人é½ browse åºä¾Â.
use customers set filter to customers.id="S01" go top browse
注æÂÂÃ¥ÂÂ,éÂÂè£Âçºä»Â麼說æÂÂæÂÂæÂÂæÂÂ客æ¶編èÂÂÃ¥ÂÂé¢çº "S01" çÂÂ人é½ browse åºä¾Âå¢??éÂÂÃ¥ÂÂÃ¥ÂÂ,æ¯å çº VFP å¯以é¸æÂÂÃ¥ÂÂæÂÂä¸ÂÃ¥ÂÂ精確æ¯Âå°Â( set exact on / set exact off ). æÂÂè¬ÂçÂÂ精確æ¯Âå°Â,æÂÂæÂÂå°±æ¯忠é Âè¦Âå®Â堨符åÂÂ,æ¢Â件æÂÂæÂÂæÂÂç«Â,ä¹Âå°±æ¯說 "S01" æÂÂçÂÂæ¼ "S01" èÂÂä¸ÂçÂÂæ¼ "S0100". VFP é Âè¨Âè¡Âçºæ¯éÂÂ精確æ¯Âå°Â,ä¹Âå°±æ¯說 "S01" æÂÂçÂÂæ¼ "S0100" ä¹ÂæÂÂçÂÂæ¼ "S01". éÂÂÃ¥ÂÂè¨Âå®Âå¯以ç´æÂ¥å° ((MasteringVFP/1/4|Options)) å»è¨Âå®Â,ä¹Âå¯以ç´æ¥使ç¨ set exact å»è¨Âå®Âçº on æ off.
å°éÂÂ裡,ç¸信é½æÂÂç½ Filter å¦Âä½Â使ç¨äºÂå§~ ä¸ÂéÂÂ,å¦ÂæÂÂä½ Remote View + Filter çÂÂæÂÂÃ¥ÂÂ,æÂÂç¼ç¾æÂÂçÂÂå¾Âæ ¢. éÂÂæ¯å çº Filter æÂÂéÂÂè¦ÂæÂÂæÂÂè³ÂæÂÂ,æÂÂè½åÂÂ篩é¸çÂÂÃ¥ÂÂä½Â,æÂÂ以 Remote View æÂÂ試åÂÂä¸Âè¼ÂæÂÂæÂÂé 端è³ÂæÂÂÃ¥ÂÂä¾Â.ä½ÂéÂÂä¹Âä¸Âæ¯說 Filter ä¸Â好,åªæ¯,ä½ å¿ é Âè¦ÂäºÂ解ä»ÂçÂÂåª缺é»Â,èÂÂå ¶ä»ÂæÂÂ令交äºÂæÂÂé Â使ç¨,æÂÂè½ç¼æ®å®ÂçÂÂæÂÂÃ¥ÂÂ.