This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

adding a linefeed. and wanting ascii and chr commands

Help for those learning Tcl or writing their own scripts.
Post Reply
t
topdawg_b
Voice
Posts: 32
Joined: Sun Dec 07, 2008 7:13 pm

adding a linefeed. and wanting ascii and chr commands

Post by topdawg_b »

hi im using.
set out [open $recfile$ext w]
puts $out $text
close $out
everything works in the program fine but when the textfile is opened with wordpad all the text is on 1 line.
what can I add to $text to make it put a linefeed or new line command that the worpad would recognize

2. in mirc they have a $chr(num) command thats prints an ascii character and a asc("char") command that gives u the ascii number of a character. does eggdrop have such commands?

thanks . this is a great site
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

1. Are you making this file under some Linux OS and after that u trying to look into it under windows OS?

for linux can be \n, for windows can be \r\n or just \r, try.

2. try

Code: Select all

set char "a" 
scan $char "%c" int 
puts $int
t
topdawg_b
Voice
Posts: 32
Joined: Sun Dec 07, 2008 7:13 pm

Post by topdawg_b »

the \r\n did the trick ty
t
topdawg_b
Voice
Posts: 32
Joined: Sun Dec 07, 2008 7:13 pm

Post by topdawg_b »

the scan $char "%c" int converts to an ascii number what prints a char from an ascii number
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

topdawg_b wrote:the scan $char "%c" int converts to an ascii number what prints a char from an ascii number

Code: Select all

set char [format %c $int]
t
topdawg_b
Voice
Posts: 32
Joined: Sun Dec 07, 2008 7:13 pm

Post by topdawg_b »

thank you
Post Reply