Various subjects

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

[Get some chars]

Andy Kurnia posted a function called getsc which he would like to have built-in
in
Euphoria. The main reason to this was that the function would not cost any
statements,
but it would also be faster.
Well, I have no solution for the statement count, but here is a version that is
about
50% faster (at least in my computer). The difference is that, in the original
function,
t grows in size each time a new character is read from the file, so it is
necessary to
reallocate space to store the sequence. In this function, all the space needed
is
allocated at the beggining. (see perform.doc)

global function faster_getsc(integer fn, integer len)
    sequence t
    t = repeat(0,len)
    for i = 1 to len do
        t[i]=getc(fn)
    end for

    while length(t) do
        if t[length(t)] != -1 then
            exit
        end if
        t = t[1..length(t) - 1]
    end while
    return t

end function

I hope it will be helpful for someone. If it isn't, just ignore it.



[File Naming in Win95]

The problems with file extensions could be happening because the "Hide MS-DOS
extensions
for registered file types" option is enabled. When it is enabled, Windows 95
won't let
you change the file extension when it is not shown (I'm just guessing, maybe
that's not
the problem). You can find this option in the 'Options' dialog box that can be
accessed
from the Windows Explorer 'View' menu.
About the Wordpad thing, I found out that when you use an extension that is
registered (such as .bmp),
it doesn't write ".txt" or ".doc" after it, otherwise it does. Really useful
feature,
isn't it?
Talking about Wordpad, does anyone know why it won't allow you to open an
executable?


[Euphoria X Perl]
I don't program in Perl, I know nothing about Perl, but I think there is one big
difference that was not pointed out: sequences. Does Perl allow you to create a
sequence
containing atoms and another sequences? That is the biggest difference of
Euphoria when
compared to other languages, and that is what makes Euphoria so easy and
powerful. If Perl
allows it, I'm sorry, but I haven't heard of any other language with this
feature.


BTW [1] , I receive the daily digest, so if anyone replies to this message I'll
probably
not read it until tomorrow.

BTW [2], this is my first post to this list, so please don't hit me too hard if
I said
something wrong...

Regards,
Davi T. Figueiredo
davitf at usa.net


____________________________________________________________________
Get free e-mail and a permanent address at http://www.amexmail.com/?A=1

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

Search



Quick Links

User menu

Not signed in.

Misc Menu