1. Type help

------=_NextPart_000_000A_01BE8186.93631EA0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hey, I'm trying to make an RGB type and this is what I've come up with.  =
Every time I try to implement it though it claims I am trying to =
redefine the variable i.  I've tried changing the name of i.  But I =
still get this error  Can anybody help.  What follows is the type I came =
up with.


type RGB_Trip(sequence redgreenblue)

   integer l, i

   l =3D length(redgreenblue)
   if l > 3 then
      return 0
   end if
   for i =3D 1 to 3 do
      if sequence(redgreenblue[i]) then
         return 0
      elsif redgreenblue[i] > 0 then
         return 0
      elsif redgreenblue[i] > #FF then
         return 0
      end if

   end for

end type


------=_NextPart_000_000A_01BE8186.93631EA0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Hey, I'm trying to make an RGB type =
and this is=20
what I've come up with.&nbsp; Every time I try to implement it though it =
claims=20
I am trying to redefine the variable i.&nbsp; I've tried changing the =
name of=20
i.&nbsp; But I still get this error&nbsp; Can anybody help.&nbsp; What =
follows=20
is the type I came up with.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>type RGB_Trip(sequence=20
redgreenblue)</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; integer l, =
i</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; l =3D=20
length(redgreenblue)<BR>&nbsp;&nbsp; if l &gt; 3=20
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0<BR>&nbsp;&nbsp; end=20
if<BR>&nbsp;&nbsp; for i =3D 1 to 3 do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
if=20
sequence(redgreenblue[i])=20
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return=20
0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elsif redgreenblue[i] &gt; 0=20
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return=20
0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elsif redgreenblue[i] &gt; #FF=20
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return=20
0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end if</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; end for</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>end =

------=_NextPart_000_000A_01BE8186.93631EA0--

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu