1. Million thanks

------=_NextPart_000_0043_01C00B4A.35AF4BE0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thank you all for giving me courage. Specially Mike the Spike, Irv =
Mullins, L(Rett) Williams, John Connrod, Alex Ford and again MTS (Mike =
the Spike).

Chapter 12 of ABGATE2 by David Gay is about Advanced Data Object =
Handling in which David suggests that its the most important in learning =
EU.

variable  =3D variable[1]        --Why is this [1] here?

Also, is it really necessary to read all the guide when i can do =
looping, a little bit about graphics modes, accepting data from key =
board, displaying text data on keyboard, data types such as atoms, =
sequences, integers and objects. Will you tell me what kind of program =
should i code now? Here is something i coded just now.

------------------Program Code-------------------------
include graphics.e
include get.e
object kyo
kyo =3D graphics_mode(18)
clear_screen()
atom name
clear_screen()
position(10,30)
puts(1, "****Greeting System****\n")
puts(1, "Choose from the following cata\n")
puts(1, "1. For Asif\n")
puts(1, "2. For Baloch\n")
puts(1, "3. For Third\n")
name =3D prompt_number("Ener number\n", {})
if name =3D1  then
    puts(1, "You have pressed 1 for Asif. His complete name is Asif =
Masood\n")
    for dob =3D 621978 to 621978  do
 printf(1, "His date of birth is %1.f", dob)
    end for
elsif name =3D 2 then
    puts(1, "You pressed 2 for Baloch\n")
    for dob =3D 234324 to 234324 do
 printf(1, "His date of birth is %1.f\n" , dob)
    end for
elsif name =3D 3 then
    puts(1, "You have pressed 3 for Thirs. Her complete name is Sara =
Hashim\n")
    for dob =3D 90789 to 90789 do
 printf(1, "Her date of birth is %1.f\n" , dob)
    end for
end if
--------------------End of Code-----------------------


------=_NextPart_000_0043_01C00B4A.35AF4BE0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thank you all for giving me courage. =
Specially Mike=20
the Spike, Irv Mullins, L(Rett) Williams, John Connrod, Alex Ford and =
again MTS=20
(Mike the Spike).</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Chapter 12 of ABGATE2 by David Gay is =
about=20
Advanced Data Object Handling in which David suggests that its the most=20
important in learning EU.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>variable &nbsp;=3D=20
variable[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --Why is this [1]=20
here?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Also, is it really necessary to read =
all the guide=20
when i can do looping, a little bit about graphics modes, accepting data =
from=20
key board, displaying text data on keyboard, data types such as atoms,=20
sequences, integers and objects. Will you tell me what kind of program =
should i=20
code now? Here is something i coded just now.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>------------------Program=20
Code-------------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>include graphics.e<BR>include =
get.e<BR>object=20
kyo<BR>kyo =3D graphics_mode(18)<BR>clear_screen()<BR>atom=20
name<BR>clear_screen()<BR>position(10,30)<BR>puts(1, "****Greeting=20
System****\n")<BR>puts(1, "Choose from the following cata\n")<BR>puts(1, =
"1. For=20
Asif\n")<BR>puts(1, "2. For Baloch\n")<BR>puts(1, "3. For =
Third\n")<BR>name =3D=20
prompt_number("Ener number\n", {})<BR>if name =3D1&nbsp;=20
then<BR>&nbsp;&nbsp;&nbsp; puts(1, "You have pressed 1 for Asif. His =
complete=20
name is Asif Masood\n")<BR>&nbsp;&nbsp;&nbsp; for dob =3D 621978 to =
621978&nbsp;=20
do<BR>&nbsp;printf(1, "His date of birth is %1.f", =
dob)<BR>&nbsp;&nbsp;&nbsp;=20
end for<BR>elsif name =3D 2 then<BR>&nbsp;&nbsp;&nbsp; puts(1, "You =
pressed 2 for=20
Baloch\n")<BR>&nbsp;&nbsp;&nbsp; for dob =3D 234324 to 234324=20
do<BR>&nbsp;printf(1, "His date of birth is %1.f\n" , =
dob)<BR>&nbsp;&nbsp;&nbsp;=20
end for<BR>elsif name =3D 3 then<BR>&nbsp;&nbsp;&nbsp; puts(1, "You have =
pressed 3=20
for Thirs. Her complete name is Sara Hashim\n")<BR>&nbsp;&nbsp;&nbsp; =
for dob =3D=20
90789 to 90789 do<BR>&nbsp;printf(1, "Her date of birth is %1.f\n" ,=20
dob)<BR>&nbsp;&nbsp;&nbsp; end for<BR>end if</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>--------------------End of=20

------=_NextPart_000_0043_01C00B4A.35AF4BE0--

new topic     » topic index » view message » categorize

2. Re: Million thanks

>Thank you all for giving me courage. Specially Mike the Spike, Irv Mullins,
>L(Rett) Williams, John Connrod, Alex Ford and again MTS (Mike the Spike).

No problem man!
Thank *YOU*!

>Chapter 12 of ABGATE2 by David Gay is about Advanced Data Object Handling
>in which David suggests that its the most important in learning EU.
>
>variable  = variable[1]        --Why is this [1] here?

Because the second variable, 'variable[1]', is a Sequence variable.
This means that it does not hold one value, but a lot of values.
A sequence is what it's name says it is: a SEQUENCE of variables.

In Euphoria you basically have 2 kinds of variables.
Single value, or multiple value.
Integers and Atom are single-value variables because they can only hold one
value. For example;
atom Asif
Asif = 1

integer Test
Test = 50

A Sequence, is a multiple-value variable. It is the only one in Euphoria.
As you saw above, all you can do with Integers and Atoms, is give them one
value. Like 10 or 60. But a sequence, you can give as many values as you
want. Like this;

sequence values
values = {10, 50, 69698, 2.6}

Now, to get at ONE of the values you stored in "values", you do this;
atom ten
ten = values[1]

Doing so you state that 'ten' gets the value wich is at position Nr. 1 in
values, because, as you saw, you said that values = {10, 50, 69698, 2.6}.
values[1] is '10', values[2] is '50', values[3] is 69698, values[4] is
'2.6'. It just means that you are reffering to the value at the position
inside the [] braces.

I hope this helps.

>Also, is it really necessary to read all the guide when i can do looping, a
>little bit about graphics modes, accepting data from key board, displaying
>text data on keyboard, data types such as atoms, sequences, integers and
>objects. Will you tell me what kind of program should i code now? Here is
>something i coded just now.

You sound like you know enough to drop the ABGTE guide and simply use the
Euphoria refference manual (refman.doc) whenever you get stuck somewhere.

>------------------Program Code-------------------------
>include graphics.e
>include get.e
>object kyo
>kyo = graphics_mode(18)
>clear_screen()
>atom name
>clear_screen()
>position(10,30)
>puts(1, "****Greeting System****\n")
>puts(1, "Choose from the following cata\n")
>puts(1, "1. For Asif\n")
>puts(1, "2. For Baloch\n")
>puts(1, "3. For Third\n")
>name = prompt_number("Ener number\n", {})
>if name =1  then
>     puts(1, "You have pressed 1 for Asif. His complete name is Asif
>Masood\n")
>     for dob = 621978 to 621978  do
>  printf(1, "His date of birth is %1.f", dob)
>     end for
>elsif name = 2 then
>     puts(1, "You pressed 2 for Baloch\n")
>     for dob = 234324 to 234324 do
>  printf(1, "His date of birth is %1.f\n" , dob)
>     end for
>elsif name = 3 then
>     puts(1, "You have pressed 3 for Thirs. Her complete name is Sara
>Hashim\n")
>     for dob = 90789 to 90789 do
>  printf(1, "Her date of birth is %1.f\n" , dob)
>     end for
>end if
>--------------------End of Code-----------------------
>

You program seems good, but why do you use a For loop to print out a number?
You do:
for dob = 90789 to 90789 do
  printf(1, "Her date of birth is %1.f\n" , dob)
end for
While you can just say:
printf(1, "Her date of birth is %1.f", 90789)

Also, you can do the following;
printf(1, "Her date of birth is Day: %d, Month: %d, Year: %d",{9,07,89})
Wich makes things prettier :p




Mike The Spike
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu