Original date:2021-05-26 08:40:09 Edited by: petelomax Subject: Re: replace()ing a crash

Graeme said...

suddenly started exiting without any warning or output.

Can you try this:

function replace3(sequence s,object o1,object o2)  
    for x=1 to length(s) do  
        if equal(s[x],o1) then  
        end if  
    end for  
    return s  
end function  
?replace3({"this","that"},"that","other")   -- {"this","other"} 
function replace4(sequence s,object o1,object o2)  
    s[o2..o2] = o1 
    return s  
end function  
?replace4({"this","that"},"that","other")   -- ??? 

Should that be crashing (on Euphoria) without a proper message/ex.err then it should be looked into (but not by me, sorry).

Note that Phix [not that you use that] needed a minor tweak to builtins/VM/pFixup.e to report the error correctly inside replace4() (many thanks), although it did at least show the failing call to replace4().

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu