Win32Lib Update

new topic     » goto parent     » topic index » view thread      » older message » newer message

The function reverse() is missing from v 0.15a.
Here's my attempt at a reverse() function. Before you start a new thread,=
 I
know this one probably isn't the fastest and doesn't reverse sequences
within sequences.
But it is useful, short and clean, IMO.

---
function reverse(sequence x)
integer len
sequence temp
    len =3D length(x)
    temp =3D repeat("", len)
    for n =3D 1 to len do
        temp[n] =3D x[len - n + 1]
    end for
    return temp
end function

-- testing
sequence name
name =3D "Ad Reinks"  -- misspelled

name =3D name[1..4] & reverse(name[5..6]) & name[7..9]
puts(1, name)
-- please, fix this bug too?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu