C+ C NAME: C Str2Str C PURPOSE: C Copy string to another string C CATEGORY: C Strings: write string to string C CALLING SEQUENCE: integer function Str2Str(cStr1,cStr2) C INPUTS: C cStrI character*(*) string to be processed C OUTPUTS: C Str2Str integer length non-trivial part of output string C CALLS: C itrim C SEE ALSO: C Str2StrSet, Int2Str, Int2StrSet, Flt2Str C INCLUDE: include 'str2str_inc.h' C PROCEDURE: C The input string cStrI is put in the output string subject to the C constraints set by Str2StrSet. C A sequence of Str2Str, Int2Str and Flt2Str calls can be used to build C a string without explicitly referring to locations in the destination C string: C I = 0 C I = I+Str2Str(cStr1, cStrO(I+1:)) C I = I+Int2Str(iNum , cStrO(I+1:)) C I = I+Str2Str(cStr2, cStrO(I+1:)) C MODIFICATION HISTORY: C JAN-1995, Paul Hick (UCSD) C- character cStr1*(*) character cStr2*(*) integer Str2StrSet integer iFill /STR__TRIM/ save iFill if (iFill .eq. STR__TRIM) then Str2Str = itrim(cStr1) cStr2 = cStr1 else if (iFill .eq. STR__NOTRIM) then Str2Str = len(cStr1) cStr2 = cStr1 else if (iFill .eq. STR__LEFTADJUST) then Str2Str = len(cStr2) cStr2 = cStr1 else if (iFill .eq. STR__RIGHTADJUST) then Str2Str = len(cStr2) i = Str2Str-len(cStr1) if (i .gt. 0) cStr2(:i) = ' ' cStr2(i-min(0,i)+1:) = cStr1(-min(0,i)+1:) end if Str2Str = min(Str2Str,len(cStr2)) return C+ C NAME: C Str2StrSet C PURPOSE: C Set mode of string insertion in href=Str2Str= C CALLING SEQUENCE: entry Str2StrSet(nFill) C INPUTS: C iSet integer insertion mode; default: STR__TRIM C Any of the values in include file C str2str_inc.h can be used: STR__TRIM, C STR__NOTRIM,STR__LEFTADJUST,STR__RIGHTADJUST C OUTPUTS: C Str2StrSet integer previous insertion mode C CALLS: C itrim C SEE ALSO: C Str2Str, Int2Str, Int2StrSet C PROCEDURE: C Str2StrSet is an entry point in function Str2Str. C Typically it is used before and after one or more Str2Str calls to C restore a previously set insertion mode: C C iSet = Str2StrSet(STR__NOTRIM) Set new insertion mode, save old one C ( calls to Str2Str ) C iSet = Str2StrSet(iSet) Restore old insertion mode C MODIFICATION HISTORY: C JAN-1995, Paul Hick (UCSD) C- Str2StrSet = iFill iFill = nFill return end