× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Procedure Problem
  • From: "Mark Walter" <mwalter@xxxxxxxxxx>
  • Date: Mon, 20 Dec 1999 14:57:16 -0500

All,
 
I have a service program of string handling routines I am trying to develop. I have a procedure called "Center" that receives a string and an output len then centers the text into a field. I defined the parameters as 256 with the CONST and OPTIONS(*varsize) keywords. The problem is when i try to pass a sub-element of a data structure to the procedure, the entire data structure is passed, not just the sub-element. I have included code snippets below.
 
TIA
 
Mark Walter
 
Test program module source
 
    Dshiptods         ds           155                            
    D dsshpnm                       35    OVERLAY(shiptods:1)     
    D dsship1                       35    OVERLAY(shiptods:36)    
    D dsship2                       35    OVERLAY(shiptods:71)    
    D dsship3                       35    OVERLAY(shiptods:106)   
    D dsshpst                        2    OVERLAY(shiptods:141)   
    D dsshpzp                       10    OVERLAY(shiptods:143)   
    D dsshpco                        3    OVERLAY(shiptods:153)   
     *                                                            
    Dlen              s              3p 0 INZ(35)                 
    Doutput           s             35                            
    Dcusno            s              8  0 inz(206800)             
    Dstore            s              8    inz('A1889')            
     *                                                            
    C                   EVAL      shiptods = GetShipto(cusno:store)
                                                                  
    C                   EVAL      output = Center(dsshpnm:len)    
    C   output       DSPLY                                     
    C                   CLEAR                   output            
String handling service program
 
   HNOMAIN                                                                     
    * module prototypes                                                        
   DCenter           PR           256                                          
   D instring                     256    OPTIONS(*varsize) CONST               
   D strlen                         3p 0 CONST                                 
    * Procedure Interface                                                      
   PCenter           B                   EXPORT                                
   DCenter           PI           256                                          
   D instring                     256    OPTIONS(*varsize) CONST               
   D strlen                         3p 0 CONST                                 
    * work fields                                                              
   D outstring       S            256                                          
   Dwork_arr         S              1    DIM(256)                              
   Dx                S              3  0                                       
   Dstrt             S              3  0                                       
     C                   MOVEA     instring      work_arr                         
 
Instring contains the entire data structure

 
 

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.