MasteringVFP/2/6/1
出自VFP Wiki
(修訂版本間差異)
小 (revert) |
|||
| 第40行: | 第40行: | ||
這樣不是簡單許多嗎?? | 這樣不是簡單許多嗎?? | ||
一般來說, Procedure 是不會傳回值的,但 VFP 的 Procedure 比較特別,它可以傳回值也可以不傳回值. | 一般來說, Procedure 是不會傳回值的,但 VFP 的 Procedure 比較特別,它可以傳回值也可以不傳回值. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
在2005年4月2日 (六) 09:46所做的修訂版本
Procedure
程序,我們可以將常用的指令集合到一起~這樣就不必再剪貼那麼多程式碼了~
例如:
use customers go top locate for cust_id=="A" if found() && do something endif use in customers use customers go top locate for cust_id=="B" if found() && do something endif use in customers
我們就可以化簡為:
do findCustomer with "A"
do findCustomer with "B"
procedure findCustomer
lparameters lc_id
use customers
go top
locate for cust_id==lc_id
if found()
&& do something
endif
use in customers
endproc
這樣不是簡單許多嗎?? 一般來說, Procedure 是不會傳回值的,但 VFP 的 Procedure 比較特別,它可以傳回值也可以不傳回值.