TOUGH PROBLEM

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

------=_NextPart_000_0012_01BFB14F.15E19020
        charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

could you add code to this function,
so that it will return {formated text=20
(s, what is returned now),
sequnce with with positions where
CHARACTERS and NUBERS are,=20
i need them so can display text colored (red for
numbers, YELLOW for strings)

i just can't do it! it is complicated

function print_format2( object o )

    -- returns object formatted for wPrint
    sequence s

    if atom( o ) then
        -- number
  if o >=3D ' ' and o <=3D '}' then
    --return CHARACTER
   return sprintf( "'%s'", o )
  else
    --return NUMBER
   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] )
            if i < length( o ) then
                s =3D s & ","
            end if
        end for
        s =3D s & "}"
        return s
    end if

end function


------=_NextPart_000_0012_01BFB14F.15E19020
        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>could you add code to this=20
function,</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>so that it will return =
{formated text=20
</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>(s, what&nbsp;is returned=20
now),</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>sequnce with with positions=20
where</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>CHARACTERS and NUBERS are, =
</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>i need them so can display =
text colored=20
(red for</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>numbers, YELLOW for =
strings)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>i just can't do it! it is=20
complicated</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>function print_format2( =
object o=20
)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>&nbsp;&nbsp;&nbsp; -- returns =
object=20
formatted for wPrint<BR>&nbsp;&nbsp;&nbsp; sequence s</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>&nbsp;&nbsp;&nbsp; if atom( o =
)=20
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- =
number<BR>&nbsp;&nbsp;if o=20
&gt;=3D ' ' and o &lt;=3D '}' then</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>&nbsp;&nbsp;&nbsp; --return=20
CHARACTER<BR>&nbsp;&nbsp;&nbsp;return sprintf( "'%s'", o=20
)<BR>&nbsp;&nbsp;else</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>&nbsp;&nbsp;&nbsp; --return=20
NUMBER</FONT></DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>&nbsp;&nbsp;&nbsp;return =
sprintf( "%d", o=20
)<BR>&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;=20
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --=20
list<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s =3D=20
"{"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i =3D 1 to length( =
o )=20
do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
s =3D s=20
&amp; print_format2( o[i]=20
)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
if i=20
&lt; length( o )=20
;&nbsp;&nbsp;&nbsp;&nbsp;=20
s =3D s &amp;=20
 end=20
if<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end=20
for<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s =3D s &amp;=20
"}"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return =
s<BR>&nbsp;&nbsp;&nbsp;=20
end if</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Lucida Casual" size=3D2>end=20

------=_NextPart_000_0012_01BFB14F.15E19020--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu