function replace_string, label, keyword, old_string, new_string ;+ ;$Log: ; ; NAME: ; replace_string ; ; PURPOSE: ; Replace specific strings of label contents ; ; CATEGORY: ; AMIE Calibration ; ; CALLING SEQUENCE: ; new_label = replace_string(label, keyword, old_string, new_string) ; ; INPUTS: ; label: the label from which the contents will be modified ; keyword: the label keyword from which the string to be modified belongs ; old_string: the string that must be modified ; new_string: new value for the string ; ; OPTIONAL INPUT PARAMETERS: ; None. ; ; OUTPUTS: ; label with modified contents ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; Hopefully none. ; ; RESTRICTIONS: ; New string must have the same size as the old one ; ; MODIFICATION HISTORY: ; 2004 Feb 18, MA: First version ; ; (c) 2004, Miguel Almeida, ESA/RSSD ;- keyword_content = pdspar(label, keyword) string_pos = strpos(keyword_content, old_string) if string_pos gt 0 then begin strput, keyword_content, new_string, string_pos label = pdsupdatekeyword(label, keyword, keyword_content(0)) endif return, label end