Hi 2 all
Is I am doing write
useing VFP 7.0
I am working an a multi user inventory control software

1 :- The sales invoice saves in a cursor. I append record in sales table
from cursor using This command
Append from dbf(â??cur_salesâ??)â?? && cur_sales is cursor name
Some time in very rare the sales table have not append the record from
cursor why this is happens and how to handle it.

2 :- I have a separate function which perform stock deduction I call it in
this way

SELECT cur_sales && cur_sales is cursor name
SCAN
nserial=serial
ncomp_no=comp_no
cbatch_no=batch_no
nqty=qty
nbonus=bonus
ntrad_price=trad_price
ntype=1
stock_sale(nserial,ncomp_no,cbatch_no,nqty,nbonus,ntrad_price,ntype)
ENDSCAN

&& stock_sale is a function

Is i am doing write or have some other good technique.


--
Qaiser Me

Re: VFP 7 by Eric

Eric
Sun Oct 09 14:52:57 CDT 2005

1) do you get an error message?
2) you don't need to store the values from the tables in memory first. Try:

SELECT cur_sales && cur_sales is cursor name
SCAN
stock_sale(cur_sales.serial,cur_sales.comp_no,cur_sales.batch_no, ;
cur_sales.qty,cur_sales.bonus,cur_sales.trad_price,1)
ENDSCAN

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts
Microsoft MVP for Visual FoxPro

"QaiserMehmood" <qaiserme@fastmail.fm> wrote in message
news:D854B1C2-3B77-4D3D-81B2-AE4DD316B069@microsoft.com...
> Hi 2 all
> Is I am doing write
> useing VFP 7.0
> I am working an a multi user inventory control software
>
> 1 :- The sales invoice saves in a cursor. I append record in sales table
> from cursor using This command
> Append from dbf("cur_sales")" && cur_sales is cursor name
> Some time in very rare the sales table have not append the record from
> cursor why this is happens and how to handle it.
>
> 2 :- I have a separate function which perform stock deduction I call it in
> this way
>
> SELECT cur_sales && cur_sales is cursor name
> SCAN
> nserial=serial
> ncomp_no=comp_no
> cbatch_no=batch_no
> nqty=qty
> nbonus=bonus
> ntrad_price=trad_price
> ntype=1
> stock_sale(nserial,ncomp_no,cbatch_no,nqty,nbonus,ntrad_price,ntype)
> ENDSCAN
>
> && stock_sale is a function
>
> Is i am doing write or have some other good technique.
>
>
> --
> Qaiser Me



Re: VFP 7 by Anders

Anders
Mon Oct 10 03:10:46 CDT 2005

You may need to make sure Sales is the current table before APPEND
SELECT Sales
APPEND FROM DBF("Cur_sales")

Besides what Eric suggested you can use SCATTER to move data in variables
SELECT Cur_sales
LOCAL ntype,llSuccess,serial, comp_no,batch_no,bonus,trad_price
SCAN
SCATTER FIELDS serial, comp_no,batch_no,bonus,trad_price MEMVAR
ntype=1
llSuccess=stock_sale(M.serial,M.comp_no,M.batch_no,M.qty,M.bonus,M.trad_price,M.ntype)IF NOT llSuccesMESSAGEBOX('Uh?')ENDIFENDSCANAs of VFP8 you can move data between tables like this:INSERT INTO Sales (serial, comp_no,batch_no,bonus,trad_price) ; SELECT serial, comp_no,batch_no,bonus,trad_price FROM Cur_sales ;-Anders"QaiserMehmood" <qaiserme@fastmail.fm> skrev i meddelandetnews:D854B1C2-3B77-4D3D-81B2-AE4DD316B069@microsoft.com...> Hi 2 all> Is I am doing write> useing VFP 7.0> I am working an a multi user inventory control software>> 1 :- The sales invoice saves in a cursor. I append record in sales table> from cursor using This command> Append from dbf("cur_sales")" && cur_sales is cursor name> Some time in very rare the sales table have not append the record from> cursor why this is happens and how to handle it.>> 2 :- I have a separate function which perform stock deduction I call it in> this way>> SELECT cur_sales && cur_sales is cursor name> SCAN> nserial=serial> ncomp_no=comp_no> cbatch_no=batch_no> nqty=qty> nbonus=bonus> ntrad_price=trad_price> ntype=1> stock_sale(nserial,ncomp_no,cbatch_no,nqty,nbonus,ntrad_price,ntype)> ENDSCAN>> && stock_sale is a function>> Is i am doing write or have some other good technique.>>> --> Qaiser Me