

IF_ParseGapString := function( obj )
    obj := ReplacedString( obj, "\\", "\\\\" );
    obj := ReplacedString( obj, "\"", "\\\"" );
#    obj := EscapeCharsInString( obj );
    return Concatenation( "\"", obj, "\"" );
end;



IF_ParseGapList := function ( IF_xxx, list, begin_str, end_str )
    local  str, length, i, len;
    length := Length( list );
    len := 0;
    str := begin_str;
    for i  in [ 1 .. length ]  do
        Append( str, IF_ConvertFromGap( IF_xxx, list[i] ) );
        if i < length  then
            Append( str, ", " );
        fi;
        if Length( str ) - len >= 500  then
            Append( str, "\n" );
            len := Length( str );
        fi;
    od;
    Append( str, end_str );
    return str;
end;

