5.0.13 vs 5.0.14 declared values

GCC Consulting gcc at optonline.net
Sat Nov 6 18:19:07 PST 2004


Just finished rewriting a sub-routine that wasn't working properly.  I wrote it
on my workstation running 5.0.15 native 5 user development & runtime.

The routine copies an existing order to a new order for a different store. Each
order detail has a line # field.  Index A is built on order # and line #.

When auto process runs a routine counts the number of details line in the order
and displays it using the dummy field dp.

Since I wanted to insure that all of the details were copied, I declared global
LAST_LINE(3,.0) in auto processing and set it equal to dp.

In input processing I declare extern last_line. 

The last line of the order detail posting routine is:

382  -------   -   -   -   -   -   -   -   -   -   -   -
     382 If: ln lt last_line
       Then: ct="1";ln=ln+"1";GOTO post

To insure each line is posted, the lookup value lv is set to lv=pn&ln rather
then using a getnext.
                                                                ^^^^^
	                                                          order#& line #
- index A    

My problem was that this routine worked perfectly on 5.0.13 but when I moved it
to my laptop running 5.0.14, it didn't work.

What I found was that I needed to, in auto processing, declare
last_line(3,.0,g).  When I did this, everything worked perfectly.

Has anyone else found that a routine using declared values stopped working
correctly with version 5.0.14.

Below is a complete listing of the routine in question.

The called routine, "count_line" gets the line count when not copying the order
displayed.


Richard Kreiss

@keyr    If: '***************************************************************
  322  Then: '* routine to repeat or copy a previously entered order
         If: '* 1. find out what is order is being copied
  323  Then: '* 2. get new store #
         If: '* 3. copy in header and change company #
  324  Then: '* 4. copy order detail to array and then new array then post out
         If: '* 5. End
  325  Then: '***************************************************************
         If: 'set flag for return from @keyc
  326  Then: f(1,.0) = "9";ct(2,.0)="1";rn="1";old_comp=company_number
  327  Then: dim magda(4)
  328  Then: magda["1"]="Repeat This Order";magda["2"]="Repeat last Order";
             magda["3"]="Repeat an Order";magda["4"]="EXIT"
  329  Then: ls=listbox(magda)
         If: ls = "4"
  330  Then: EXIT
         If: ls = "3"
  331  Then: GOTO get_num
         If: ls = "2"
  332  Then: pn(6,.0,g)=purchase_order_number-"1";xp=pn;CALL "count_line";
         If: ls = "1"
  333  Then: pn=purchase_order_number;
  334  Then: GOTO get_pon
  335  Then: END
get_num  If: 
  336  Then: input ("14","5") pn "What Order # do you want to Copy? -> "
         If: pn = ""  or @sk = "BRKY"
  337  Then: cls("12","3");END
  338  Then: lookup head = ordhead  k=pn   i=A -nx
         If: NOT head
  339  Then: BEEP;ERRORBOX "1. Order # \r"<pn<"\r Not found\nCheck PO # and
             Re-Enter";GOTO get_num
  340  Then: CLS("12","3");xp=pn;call "count_line";xp=""
  341  Then: 'debug on
get_pon  If: 
  342  Then: lookup emm = em_mast  r=rn   -np
         If: NOT emm
  343  Then: GOTO get_hed
  344  Then: po=emm(10);emm(10)=emm(10)+"1";WRITE emm;sync emm;display
  345  Then: lookup -  r=free  -n
         If: NOT -
  346  Then: BEEP;ERRORBOX "Out of disk Space";EXIT
  347  Then: CLS("1","2");f="9";GOSUB @keyc;f=""
         If: 'set or blank fields from previous order
  348  Then: company_number=cn;company_name=aa
  349  Then: 'debug on
get_hed  If: 
  350  Then: lookup head = ordhead  k=pn   i=A -npx
         If: NOT head
  351  Then: BEEP;ERRORBOX "2. Order # \r"<pn<"\r Not found\nCheck PO # and
             Re-Enter";GOTO get_num
         If: 'copy in the previous details
  352  Then: copyin head
         If: 'change header details
  353  Then: 1=po;company_number=cn;company_name=aa;date_entered=@td;display;
             ar_code=xa
  354  Then: store_num="";store_ponum="";select_order="";modified_by="";
             labels_printed="";label_date="";invoice_printed=""
  355  Then: iprint_date="";pack_print="";pack_date="";scan_print="";
             scan_date="";addr_print="";addr_date="";ups_shipment=""
  356  Then: created_by=getenv("username");display
  357  Then: WRITE;CLS("12","5")
get_snu  If: 
  358  Then: input popup s_num "Enter Store PO #\nPress \kZ to Continue -> "
         If: s_num = ""
  359  Then: GOTO get_ups
  360  Then: store_ponum=s_num;display
get_ups  If: 
  361  Then: input popup ups_yn "Is this a UPS Shipment? \n(Y)es or (N)o=\kZ -
             > "
         If: ups_yn = "" or ups_yn = "N"
  362  Then: ups_shipment="N"
         If: ups_yn = "Y"
  363  Then: ups_shipment
  364  Then: display;ln="1";GOTO post_de
post_de  If: 
  365  Then: SHOW("18","15") "Copying Order Details"
post     If: 
  366  Then: lv=pn&ln
  367  Then: lookup ord = orders  k=lv   i=A -npx
         If: NOT ord
  368  Then: CLS("12","7");GOTO finish
loop_de  If: ord(1) ne pn
  369  Then: CLS("12","7");GOTO finish
cpy_arr  If: 'copy data to hold_det & change or blank vlaues not to be copied
  370  Then: ct="1"
loop_cp  If: '* copy to new array for posting
  371  Then: hold_det[ct]=old_det[ct];ct=ct+"1"
         If: ct le "25"
  372  Then: GOTO loop_cp
  373  Then: hold_det["1"]=po;hold_det["5"]="";hold_det["9"]=company_number;
             hold_det["17"]=""
  374  Then: hold_det["18"]="";hold_det["19"]="";hold_det["20"]="";
             hold_det["25"]=store_num;
         If: 'reset array counter
  375  Then: ct="1"
l_array  If: 
  376  Then: lookup newo = orders  r=free  -n
         If: NOT newo
  377  Then: ERRORBOX "Out of disk space";END
loop_ne  If: '* copy to new array for posting
  378  Then: new_det(ct)=hold_det(ct);ct=ct+"1"
         If: ct le "25"
  379  Then: GOTO loop_ne
         If: newo(4) lt "0"        'make into a positive #
  380  Then: newo(4) = newo(4)*"-1"
  381  Then: Write newo
         If: ln lt last_line
  382  Then: ct="1";ln=ln+"1";GOTO post





More information about the Filepro-list mailing list