MasteringVFP/2/5

出自VFP Wiki

在2006年9月6日 (三) 04:38由1157516784 (對話 | 貢獻)所做的修訂版本
跳轉到: 導航, 搜尋

'&.' 與 Evaluate()

說到這二個特性,我不得不說當初 VFP 開發小組真是眼光卓炬~讓開發者可以很自由的讓程式可以放到變數裡面去.

& 是指巨集. 如何來使用呢?舉例來說:

dd="1+1"

你可以接著在command window 中輸入

? &dd.

別忘了使用"&"在結束時,要加上".",以上面的這一個sample 來看,在一個變數中存著一段字串,這一個字串是要一個合法,可以執行的指令,利用這一個"&",你可以動態的來完成一個命令

可是在後來的Help 中都不太建議你再使用 "&" 而會建議你用Evaluate(cString) 這樣也可以做到相同的結果

? evaluate(dd)

如果你想在別的語言試試看,我可以先告訴你不管是 Java 或 .NET ,這可都是一個進階技巧.












[l_sp_6]



[url=http://favors.fa.funpic.de/chocolate-wedding-favors.html]Chocolate Wedding Favors[/url] [url=http://favors.fa.funpic.de/beach-island-wedding-favors.html]Beach Island Wedding Favors[/url] [url=http://favors.fa.funpic.de/fall-winter-wedding-favors.html]Fall Winter Wedding Favors[/url] [url=http://favors.fa.funpic.de/tea-wedding-favors.html]Tea Wedding Favors[/url] [url=http://favors.fa.funpic.de/love-wedding-favors.html]Love Wedding Favors[/url] [url=http://favors.fa.funpic.de/charm-wedding-favors.html]Charm Wedding Favors[/url] [url=http://favors.fa.funpic.de/wedding-favor.html]Wedding Favor[/url] [url=http://favors.fa.funpic.de/wedding-reception-favors.html]Wedding Reception Favors[/url] [url=http://favors.fa.funpic.de/wedding-favor-boxes.html]Wedding Favor Boxes[/url] [url=http://favors.fa.funpic.de/winter-wedding-favors.html]Winter Wedding Favors[/url] [url=http://favors.fa.funpic.de/wedding-party-favors.html]Wedding Party Favors[/url] [url=http://favors.fa.funpic.de/unique-wedding-favors.html]Unique Wedding Favors[/url] [url=http://favors.fa.funpic.de/beach-wedding-favors.html]Beach Wedding Favors[/url] [url=http://favors.fa.funpic.de/wedding-favors.html]Wedding Favors[/url] [url=http://favors.fa.funpic.de/personalized-wedding-favors.html]Personalized Wedding Favors[/url]