1. Help me please

I want to do something like this but I am having troubles:

sequence test
test = gets(0)
if (test = "albert") then   --  This is my prob.
puts(1,"albert")
end if

NOTE: This is just an example of what I want to do not my actual program.

Thanks,
Albert

new topic     » topic index » view message » categorize

2. Help me please

>if (test =3D "albert") then   --  This is my prob.
>puts(1,"albert")

I haven't tested this, but my hunch is this:

You cannot compare a seq with a seq and get an atom 1 or 0.

truth =3D {1,1,1,0} =3D {0,1,2,1} -- truth (I think) is {0,1,0,0}

I think what you are looking for is the compare lib routine.  Look in
LIBRARY.DOC.

Alan
 =

new topic     » goto parent     » topic index » view message » categorize

3. Re: Help me please

On Wed, 4 Nov 1998 19:37:18 EST, Albert Brauneis <Dajawu36 at AOL.COM> wrote:

>I want to do something like this but I am having troubles:
>
>sequence test
>test = gets(0)
>if (test = "albert") then   --  This is my prob.
>puts(1,"albert")
>end if
>
Try if compare(test,"albert") = 0 then -- think "zero difference"
 then --

Also, see wildcard.e, so you can convert both to upper case
when doing the compare - just in case of proper typing :)

if compare(upper(test),"ALBERT") = 0 then

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

4. Re: Help me please

Actually, gets also returns \n at the end, so you need something like this:

if compare(upper(s),"ALBERT\n") =3D 0 then

Jeffrey Fielding
JJProg at cyberbury.net

new topic     » goto parent     » topic index » view message » categorize

5. Help me please

Albert wrote:
>I want to do something like this but I am having troubles:

>sequence test
>test =3D gets(0)
-- The sequence that is typed here, ends with a newline character, so you=

have to
-- strip that off:
test =3D test[1..length(test) - 1]
>if (test =3D "albert") then   --  This is my prob.
-- no, you have to use compare():
if compare(test, "albert") =3D 0 then     -- ( '=3D 0' meaning no differe=
nce!)
    puts(1,"albert")
end if
-- now, this should work

>NOTE: This is just an example of what I want to do not my actual program=
=2E

>Thanks,
>Albert

Hope this helps, Ad

new topic     » goto parent     » topic index » view message » categorize

6. Re: Help me please

Here is another problem I am having I have a sequence that comes from
command_line() and when I try to append to that it works until I try to print
it out then it says this:

sequence found inside character string

new topic     » goto parent     » topic index » view message » categorize

7. Re: Help me please

--part0_910230497_boundary
Content-ID: <0_910230497 at inet_out.mail.aol.com.1>
Content-type: text/plain; charset=US-ASCII

Ok please ignore my last question involving the .bmp extention thing. I
figured it out. I want to apologize for my mass list of question and I want to
thank everyone who helped me. I also want to thank David Gay again because I
found the answer in his tutorial I was using append and I should have been
useing &. Thanks David. Ok you all know that I am new to euphoria about a few
week so here is a program I just made that loads .bmp's to the screen you can
either type the name of the .bmp with the .bmp extention but if you leave the
.bmp extention off it will put it on for you. Test out the program and tell me
what you think. Remember I am new so this is probably easy for you but it took
me like an hour and a half.

Thanks,
Albert

p.s. If you want the source ask me for it and I will post it.

--part0_910230497_boundary
Content-ID: <0_910230497 at inet_out.mail.aol.com.2>
Content-type: application/octet-stream;
        name="BMP.EXE"

new topic     » goto parent     » topic index » view message » categorize

8. Re: Help me please

>p.s. If you want the source ask me for it and I will post it.


Dear Albert,

Please don't post executable files (we've got some serious troubles with
that).
I personally won't even try it!

If you're also open to share the source code, it should have been better to
post it directly...
instead of a 180+ KB download all of the 240+ subscribers would have
download just
a few KBs. At least you could have zipped your attachment!

Regards,
    Daniel   Berstein
    daber at pair.com

new topic     » goto parent     » topic index » view message » categorize

9. Re: Help me please

Sorry about the big attachment.
1) I understand that you had some problems with a virus but I am a nice person
and I would never ever do that. But I am sure you still want to be carefull so
I am attaching the source code. The only reason I made it an exe is because it
uses the command_line() and I don't like the look of ex bmp.ex test.bmp but
here is the source code. Please tell me what you think about it and any tips
for speed or anything I want.

Thanks,
Albert

-------Cut Below--------
without trace
include get.e
include image.e
include graphics.e

object bitmap, junk
sequence file
integer exten

file = command_line()

if length(file) != 3 then
        puts(1, "Usage:\n")
        puts(1, "bmp <filename>.bmp")
        abort(0)
end if

exten = match(".bmp", file[3])
if (exten = 0) then
       file[3] = file[3] & {'.','b','m','p'}
end if

clear_screen()
if graphics_mode(18) then
        puts(1,"Mode 18 Failure")
else
        bitmap = read_bitmap(file[3])
        if atom(bitmap) then

                if graphics_mode(-1) then
                        puts(1, "Mode Failure")
                end if

                puts(1,"File Not Found!")
                abort(0)
        end if
        display_image({1,1},bitmap[2])
        all_palette((bitmap[1]/4))
        junk = wait_key()
end if

if graphics_mode(-1) then
        puts(1, "Mode Failure")
end if
-------End Cut here-------

new topic     » goto parent     » topic index » view message » categorize

10. Re: Help me please

Albert,

not to be rude but i think quite a few of us are exceedingly wary of
bound euphoria files.  especially since they take up so much less space
in their unbound state--and everyone can use them.

snortboy

new topic     » goto parent     » topic index » view message » categorize

11. Re: Help me please

Albert wrote:
>p.s. If you want the source ask me for it and I will post it.

Albert,

Welcome to Euphoria! However, you should now that we agreed on some rules=

for this listserver:
We don't like executables posted here, because:
- They're quite long and some people have to pay for every bit they
download, I guess.
- But what's worse: It is not straightforward to look into the executable=
,
so it may contain a virus or a 'bomb'. We've had that once, and people ar=
e
(understandably) very afraid of this happening again. So I presume lots o=
f
people will immediately delete your exe file without further ado.
- If you want help and comments regarding your code, then please post onl=
y
your .ex or .exw files and the includes that are not standard. If these
files are not too big, no one will have trouble with it. If they're
somewhat bigger, you could also consider compressing the files and then
sending them.

I trust you don't have bad intentions, but *never* do this again,

Ad.

new topic     » goto parent     » topic index » view message » categorize

12. Re: Help me please

what happened to not sending exe's over the letter?????????????????
I dont' want anouther nate on here !!!!!!!!!!!!!!!!

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu