1. unresolvable problem
------=_NextPart_000_0008_01BFB14D.FC120220
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
function which calls itself cant return varibale which changes itself =
each time
my actual function with which i am stuck:
(i want function to display text colored , characters converted from =
ascii code in one color, others in some other color)
=20
--returns {text,numberOfMembers}
function print_format3( object o )
-- returns object formatted for wPrint
sequence s
atom num
num=3D0 --each time function is called it is set to 0
if atom( o ) then
-- number
if o >=3D ' ' and o <=3D '}' then
return sprintf( "'%s'", o )
else =20
return sprintf( "%d", o )
end if
else
-- list
s =3D "{"
for i =3D 1 to length( o ) do
s =3D s & print_format2( o[i] ) --function called AGAIN (num =
is set back to 0)
--HERE! variable would=20
-- increase each time and would be then returned=20
--along with text :{text,variable}
num+=3D1
=20
if i < length( o ) then
s =3D s & ","
end if
end for
s =3D s & "}"
return s
end if
end function
Anybody has any suggestions? I can't use global variable.(?)
------=_NextPart_000_0008_01BFB14D.FC120220
charset="iso-8859-2"
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-2" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Lucida Casual" size=3D2>
<DIV><FONT face=3D"Lucida Casual" size=3D2>function which calls itself =
cant return=20
varibale which changes itself each time</FONT></DIV></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>my actual function with which =
i am=20
stuck:</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>(i want function to display =
text colored=20
, characters converted from ascii code in one color, others in some =
other=20
color)</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>--returns=20
{text,numberOfMembers}<BR>function print_format3( object o =
)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2> -- returns =
object=20
formatted for wPrint<BR> sequence s</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2> atom =
num</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2><STRONG> =
num=3D0 --each=20
time function is called it is set to 0</STRONG></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2> if atom( o =
)=20
then<BR> -- =
number<BR> if o=20
>=3D ' ' and o <=3D '}' then<BR> return sprintf( =
"'%s'", o=20
)<BR> else <BR> return =
sprintf(=20
"%d", o )<BR> end if<BR> =20
else<BR> --=20
list<BR> s =3D=20
"{"<BR> for i =3D 1 to length( =
o )=20
do<BR> =
s =3D s=20
& print_format2( o[i] ) <STRONG>--function called AGAIN (num is set =
back to=20
0)</STRONG></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Lucida Casual" =
size=3D2><STRONG> --HERE!=20
variable would</STRONG>=20
<DIV><STRONG><FONT face=3D"Lucida Casual" size=3D2> =20
-- increase each time and would be then returned =
</FONT></STRONG></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2><STRONG> =
--along with=20
text :{text,variable}</STRONG></FONT></DIV>
<DIV> </DIV></FONT></DIV>
<DIV><STRONG><FONT face=3D"Lucida Casual" size=3D2> =20
num+=3D1</FONT></STRONG></DIV>
<DIV><FONT face=3D"Lucida Casual"=20
p; <BR></FONT><FONT=20
face=3D"Lucida Casual"=20
nbsp; =20
if i < length( o )=20
; =20
s =3D s &=20
end=20
if<BR> end=20
for<BR> s =3D s &=20
"}"<BR> return =
s<BR> =20
end if</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>end function</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>
<DIV><FONT face=3D"Lucida Casual" size=3D2>Anybody has any suggestions? =
I can't use=20
------=_NextPart_000_0008_01BFB14D.FC120220--