1. ? command
- Posted by =?iso-8859-2?B?qWtvZGE=?= <tone.skoda at SIOL.NET> Apr 26, 2000
- 380 views
- Last edited Apr 27, 2000
------=_NextPart_000_0051_01BFAFC9.BAD56DE0 charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable ? command is allrite for debugging but it would be even better if it would display characters when you = would want to instead of numbers (ascii) because there is no other way you can show yourself very complicated = sequence (or anybody knows how to?) ? {"abc"} -> {97,101,102} ------=_NextPart_000_0051_01BFAFC9.BAD56DE0 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>? command is allrite for=20 debugging</FONT></DIV> <DIV><FONT face=3D"Lucida Casual" size=3D2>but it would be even better = if it would=20 display characters when you would want to instead of numbers=20 (ascii)</FONT></DIV> <DIV><FONT face=3D"Lucida Casual" size=3D2>because there is no other way = you can=20 show yourself very complicated sequence (or anybody knows how = to?)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Lucida Casual" size=3D2>? {"abc"} ->=20 ------=_NextPart_000_0051_01BFAFC9.BAD56DE0--
2. Re: ? command
- Posted by Lewis Townsend <keroltarr at HOTMAIL.COM> Apr 27, 2000
- 367 views
Hell ©koda, >? command is allrite for debugging >but it would be even better if it would display characters when you would >want to instead of numbers (ascii) >because there is no other way you can show yourself very complicated >sequence (or anybody knows how to?) > >? {"abc"} -> {97,101,102} I think printf will do it as long as you are only wanting to print a series of strings AS strings. untested code ahead: a = {"abc","def"} printf(1, "a[1]=%s\na[2]=%s", a) -- I hope I got the format right -- I don't use printf much. later, Lewis Townsend ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
3. Re: ? command
- Posted by Lewis Townsend <keroltarr at HOTMAIL.COM> Apr 27, 2000
- 366 views
Sorry folks for replying to myself but... I think you can do this too: a = {"age", 21} printf(1, "%s = %d", a) this way you can print any conbination of strings and atoms as long as you know the format you are using already. Please correct me, anyone if I'm wrong. later, Lewis Townsend ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
4. Re: ? command
- Posted by "Cuny, David at DSS" <David.Cuny at DSS.CA.GOV> Apr 27, 2000
- 379 views
=A9koda wrote: > but it would be even better if it would display=20 > characters when you would want to instead of=20 > numbers (ascii) because there is no other way=20 > you can show yourself very complicated sequence=20 > (or anybody knows how to?) Here's the core routine I use in Win32Lib: function print_format( object o ) -- returns object formatted for wPrint sequence s if atom( o ) then -- number return sprintf( "%d", o ) else -- list s =3D "{" for i =3D 1 to length( o ) do s =3D s & print_format( o[i] ) if i < length( o ) then s =3D s & "," end if end for s =3D s & "}" return s end if end function You can change the code to print chars with something like this: if atom( o ) then -- printable char? if o >=3D ' ' and o <=3D 'z' then -- print value and char return sprintf( "%d'%s'", {o,o} ) else -- print number return sprintf( "%d", o ) end if else ... Hope this helps! -- David Cuny
5. Re: ? command
- Posted by =?iso-8859-2?B?qWtvZGE=?= <tone.skoda at SIOL.NET> Apr 27, 2000
- 368 views
- Last edited Apr 28, 2000
David, your code works great here is my set of functions for debugging (along with your function as main): short names (show, showw) are because you would use them often when you are debugging print_format( object o ) global procedure wait() --shows object global procedure show(sequence name,object o) --shows object and waits for keypress global procedure showw(sequence name,object o) function print_format( object o ) -- returns object formatted for wPrint sequence s if atom( o ) then -- printable char? if o >= ' ' and o <= 'z' then -- print value and char -- return sprintf( "%d'%s'", {o,o} ) return sprintf( "%s", {o} ) else -- print number return sprintf( "%d", o ) end if else -- list s = "{" for i = 1 to length( o ) do s = s & print_format( o[i] ) if i < length( o ) then --if char dont add: , if atom(o[i])then if o[i] < ' ' or o[i] > 'z' then s = s & "," end if else s = s & "," end if end if end for s = s & "}" return s end if end function global procedure wait() atom k k=wait_key() --if escape end program if k=27 then abort(1) end if end procedure global procedure show(sequence name,object o) printf(1,"\n%s:%s",{name,print_format(o)}) end procedure global procedure showw(sequence name,object o) printf(1,"\n%s:%s",{name,print_format(o)}) wait() end procedure
6. Re: ? command
- Posted by "Cuny, David at DSS" <David.Cuny at DSS.CA.GOV> Apr 28, 2000
- 379 views
"Skoda" wrote: > David, your code works great Good to hear. -- David Cuny
7. Re: ? command
- Posted by =?iso-8859-2?B?qWtvZGE=?= <tone.skoda at SIOL.NET> Apr 28, 2000
- 364 views
repaired print_format2 function that i send yesterday function print_format2( object o ) -- returns object formatted for wPrint sequence s if atom( o ) then -- number if o >= ' ' and o <= '}' then return sprintf( "'%s'", o ) else return sprintf( "%d", o ) end if else -- list s = "{" for i = 1 to length( o ) do s = s & print_format2( o[i] ) if i < length( o ) then s = s & "," end if end for s = s & "}" return s end if end function