|
Wayne, Your procedure will work fine if you change the parameter to be "varying const" or "varying value". You should also make your returned value "field_out" to be a varying field, and set its length according to the length of "field_in". With VARYING CONST parameters, your callers don't have to do anything special about the varying fields. To others who are recommending OPTIONS(*VARSIZE) and CEEDOD. That works too, but if you can use varying fields, as Wayne can, it's much easier to code, and runs faster too. Barbara Morris - -----Original Message----- From: owner-midrange-l@midrange.com [mailto:owner-midrange-l@midrange.com]On Behalf Of Wayne Achenbaum Sent: Thursday, December 30, 1999 1:11 PM To: MIDRANGE-L@midrange.com Subject: Procedure Problem d InputData 256a Varying Options(*Varsize) *--------------------------------------------------------------------* * $Center procedure * *--------------------------------------------------------------------* p $Center B Export * d $Center PI 256a Varying d Field_In 256a Varying Options(*Varsize) * d Half s 3s 0 d Len s 3s 0 d Size_In s 3s 0 d Start s 3s 0 d Field_Out s 256a * c ' ' Checkr(E) Field_In Len c Eval Size_In = %Len(Field_In) * c If %Found c Eval Half = %Div(Len:2) c Eval Start = (((Size_In) /2) c +1) - Half c eval %Subst(Field_Out : Start : Len) = c %subst(Field_In : 1 : Len) c Return Field_Out * c Else * c Return Field_In c EndIf * p $Center E +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.