| T.R | Title | User | Personal Name
 | Date | Lines | 
|---|
| 50.1 | tpas_demosite_basic input to/from reversed | AWARD::MAGNI | IM&T - 223-9837 | Thu Dec 15 1994 15:29 | 29 | 
|  | 
  - Please tell me where the from/to codes are being mixed up (hopefully
    its the proggy, not the function)
The problem is TPAS_DEMOSITE_BASIC.BAS. That program was never fully tested
as it was just written more as a 'this is how you would place a call using 
BASIC' program.
The mistake is in the MAP it has the to/from recversed. It should be:
MAP (MAP_TPAS_TRANS_RECORD)   STRING  TPAS_REQUEST_PART       = 30%, &
	                 STRING  TPAS_TRANS_SHIP_TO_STKRM     = 07%, &
	                 STRING  TPAS_TRANS_SHIP_TO_TYPE      = 01%, &
	                 STRING  TPAS_TRANS_SHIP_FROM_STKRM   = 07%, &
	                 STRING  TPAS_TRANS_SHIP_FROM_TYPE    = 01%, &
	                 DOUBLE  TPAS_ORDER_MLP                    , &
			 .
			 .
			 .
  - Please supply a formal definition of the TPAS_CALC_TRNSFR_PRC function
    listing all the parameters, giving their generic data type, and passing
    mechanism.
I will write that up, post it here and expand in the user doc.
Lois
 | 
| 50.2 | It worked, but I'm confused... | FUTURS::TON |  | Fri Dec 16 1994 05:48 | 25 | 
|  | Lois,
I made the change you suggested to TPAS_DEMOSITE_BASIC.BAS, and it worked.
To be honest, I was very surprised. Let me explain why.
In the call to TPAS_CALC_TRNSFR_PRC, each parameter is explicitly passed.
Generally it is the order in which the parameters are listed in the call
the is significant, not the order in which the parameter variables are
declared. Changing the order in which the variables are declared should
have no effect on the call. Is there something about the relationship
between the MAP and TPAS_CALC_TRNSFR_PRC the you're not telling us? Are
imdividual parameters really being passed, or are you passing the MAP?
There is something else that I am curious about. I notice that strings are
being passed by reference, and numbers by descriptor. Generally, in BASIC
at least, things are the other way round. With a number, we use Reference
since the length of the data being passed can by derived from the data
type. With strings, the length can be variable, so you need a starting
address and a length (which is what a descriptor gives). So why use
refernece for strings and descriptors for numbers? (This is just idle
curiosity)
Thanks
george
 | 
| 50.3 | I assume the MAP and LINKAGE use the same storage | AWARD::MAGNI | IM&T - 223-9837 | Wed Dec 21 1994 11:31 | 19 | 
|  | 
>>I made the change you suggested to TPAS_DEMOSITE_BASIC.BAS, and it worked.
>>To be honest, I was very surprised. Let me explain why.
	The best explaination I can give is that a MAP defines storage
	and a LINKAGE defines storage. Even though the call is field
	by field the storage area is what is sent and received.
	I walked this through DEBUG and the FROM = "XX' & TO = "AY"
	put in the TPAS_DEMOSITE_BASIC is
	recevied in the COBOL TPAS_CALC_TRNSFR_PRC as TO = "XX" and FROM = "AY"
	when the MAP was reversed.
>>There is something else that I am curious about. I notice that strings are
>>being passed by reference, and numbers by descriptor. 
	It worked this way - that is the best I can tell you. 
Lois
 | 
| 50.4 | Fix for TPAS_DEMOSITE_BASIC.BAS | FUTURS::TON |  | Thu Jan 05 1995 10:58 | 81 | 
|  | I have examined both the BASIC and the COBOL demo programs supplied with
the TPAS II kit, and they are quite different.
The COBOL program makes a call to TPAS_CALC_TRNSFR_PRC, and passed a single
parameter (the starting address of the storage area that contains the data
elements the function uses). Yet the BASIC program passed dozens of
parameters, (the addresses of each element).
Let my offer a suggested fix to the BASIC demo program...
- add this line immediately after the %IDENT
OPTION TYPE = EXPLICIT
- Replace the MAP with
RECORD tpas_record
	STRING  tpas_request_part		= 30%
	STRING  tpas_trans_ship_to_stkrm	= 07%
	STRING  tpas_trans_ship_to_type		= 01%
	STRING  tpas_trans_ship_from_stkrm	= 07%
	STRING  tpas_trans_ship_from_type	= 01%
	DOUBLE  tpas_order_mlp                    
	DOUBLE  tpas_local_std_cost               
	WORD    tpas_ship_type_cd                  
       	STRING  tpas_rcv_from_trnsfr_area	= 03%
       	STRING  tpas_rcv_to_trnsfr_area		= 03%
        STRING  tpas_rcv_from_plnt_mnemnc	= 02%
        STRING  tpas_rcv_to_plnt_mnemnc		= 02%
        STRING  tpas_rcv_tpas_prodt_type_cd	= 03%
        DOUBLE  tpas_rcv_std_cost                  
        DOUBLE  tpas_rcv_mlp                       
        SINGLE  tpas_rcv_cmm                      
        DOUBLE  tpas_rcv_base_price                
        STRING  tpas_rcv_price_type_ind		= 01%
        SINGLE  tpas_rcv_discount_percent         
        SINGLE  tpas_rcv_std_cost_uplift           
        DOUBLE  tpas_rcv_transfer_price           
        STRING  tpas_rcv_trnsfr_prc_curncy_cd	= 03%
        STRING  tpas_rcv_std_cst_type_cd	= 01%
        DOUBLE  tpas_rcv_trnsfr_prc_rebill        
        SINGLE  tpas_rcv_dscnt_mlp_rbill          
        SINGLE  tpas_rcv_nor_dscnt                
        SINGLE  tpas_rcv_rbill_dscnt              
        STRING  tpas_rcv_subsid_bill_cd_from	= 07%
        STRING  tpas_rcv_subsid_bill_cd_to	= 07%
        STRING  tpas_rcv_busns_from_type_cd	= 03%
        STRING  tpas_rcv_busns_to_type_cd	= 03%
        DOUBLE  tpas_rcv_avg_prodt_nor_amt        
        DOUBLE  tpas_rcv_prvailing_rate           
        STRING  tpas_rcv_facility_msg		= 07%
        STRING  tpas_rcv_part_status_code	= 01%
        STRING  tpas_rcv_error_message		= 72%
        LONG    tpas_rcv_sqlerr                   
        LONG  	tpas_rcv_vms_error
END RECORD TPAS_RECORD
EXTERNAL SUB tpas_calc_trnsfr_prc(tpas_record)
DECLARE tpas_record my_tpas
- replace the call of  tpas_calc_trnsfr_prc with...
	CALL tpas_calc_trnsfr_prc ( my_tpas BY REF)
- replace all remaining references to fields that were declared in the MAP
with  appropriate references to my_tpas::. For example
    Replace
        INPUT "PART NUMBER ";  TPAS_REQUEST_PART
    with
        INPUT "PART NUMBER ";  my_tpas::tpas_request_part.
The above works for me.
George Ton
TOLAS Development
 | 
| 50.5 | thanks for the other BASIC example | AWARD::MAGNI | IM&T - 223-9837 | Mon Jan 09 1995 11:18 | 8 | 
|  | George,
Your suggestion is great. The DEMOSITE in BASIC was a quick and dirty to 
give the MAXCIM installations an idea of what the call would look like.
Thanks for you effort. Sending one record is easier to code and manage in
code changes. I am sure other BASIC sites can utilize it.
Lois
 |