1. Now for some actual euphoria/linux questions...
- Posted by Paul <draegur at WSERV.COM> Apr 17, 2000
- 490 views
Hello again everyone.. It's been a while since I have needed aid from this group (which is a good thing from my viewpoint). I have a few questions that perhaps someone out there knows the answer to. As I am sure most of you don't remember, I am recoding a mud that I created in Euphoria. I am stuck at a few points however.. First, How do I go about running the ex file in the background so that I do not have to be connected to the server machine? Second, is there any way to stop euphoria from crashing when it hits an error in a procedure or function? Instead perhaps to have it report the error to an error file and exit the routine at that point? Third, does anyone know how to alter the color of the text that I send out through the socket connections? Any help in these areas would be, as always, appreciated! Paul
2. Re: Now for some actual euphoria/linux questions...
- Posted by Kat <gertie at ZEBRA.NET> Apr 17, 2000
- 512 views
----- Original Message ----- From: "Paul" <draegur at WSERV.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Monday, April 17, 2000 8:52 AM Subject: Now for some actual euphoria/linux questions... > Hello again everyone.. It's been a while since I have needed aid from > this group (which is a good thing from my viewpoint). I have a few > questions that perhaps > someone out there knows the answer to. As I am sure most of you don't > remember, > I am recoding a mud that I created in Euphoria. I am stuck at a few > points however.. > > First, How do I go about running the ex file in the background so that I > do not have to be connected to the server machine? Run it on the server and tell the server to allow it some time to run. > Second, is there any way to stop euphoria from crashing when it hits an > error in a procedure or function? Instead perhaps to have it report the > error to an error file > and exit the routine at that point? Test all your vars to death before using them. This is going to be difficult to do without a "goto" command to get out of these situations. > Third, does anyone know how to alter the color of the text that I send > out through the socket connections? Yes, i just wrote an ansi-ascii mirc-mush translator. You must send the codes for the colors, and the associated opening and closing tags, that the mush/mud clients you use expect to see. Having done only one mush, and only for mirc, i can't say what your system needs to do for the actual codes, other than look up the olde dos screen codes and try those. Kat
3. Re: Now for some actual euphoria/linux questions...
- Posted by Pete Eberlein <xseal at HARBORSIDE.COM> Apr 17, 2000
- 514 views
On Mon, 17 Apr 2000 09:52:40 -0400, Paul <draegur at WSERV.COM> wrote: >Hello again everyone.. It's been a while since I have needed aid from >this group (which is a good thing from my viewpoint). I have a few >questions that perhaps >someone out there knows the answer to. As I am sure most of you don't >remember, >I am recoding a mud that I created in Euphoria. I am stuck at a few >points however.. > >First, How do I go about running the ex file in the background so that I >do not have to be connected to the server machine? Use: nohup exu ladedah.exu arg1 > /dev/null & "nohup" causes the program run to ignore hangup-signals when you exit "> /dev/null" prevents the program from suspending in case of tty output "&" causes it to be run in the background >Second, is there any way to stop euphoria from crashing when it hits an >error in a procedure or function? Instead perhaps to have it report the >error to an error file >and exit the routine at that point? No, and the subject has been debated heavily here already. PEu supports "crash routines" which are called before the erred program terminates, but you cannot recover to the original routine. >Third, does anyone know how to alter the color of the text that I send >out through the socket connections? kat already pointed out ANSI codes, and that's the way to go. >Any help in these areas would be, as always, appreciated! > >Paul Pete Eberlein
4. Re: Now for some actual euphoria/linux questions...
- Posted by Paul <draegur at WSERV.COM> Apr 17, 2000
- 470 views
Pete Eberlein wrote: > > > kat already pointed out ANSI codes, and that's the way to go. > http://www.linuxdoc.org/HOWTO/Bash-Prompt-HOWTO-6.html > > Pete Eberlein Well.. umm.. Did I happen to mention that I am slow? :) I read the link and have seen the ansi tag codes, yet when I try to use them in Euphoria it errors with 'unknown escape character' after the initial \ in codes such as \[\033[1;30m\]. I am missing the entire point, ain't I? Any chance for the idiots guide to what I am doing wrong here? :) (man do I hate to seem this lost...)
5. Re: Now for some actual euphoria/linux questions...
- Posted by Lewis Townsend <keroltarr at HOTMAIL.COM> Apr 17, 2000
- 464 views
Hello Paul, >Well.. umm.. Did I happen to mention that I am slow? :) >I read the link and have seen the ansi tag codes, yet when I try to use >them >in >Euphoria it errors with 'unknown escape character' after the initial \ in >codes such as >\[\033[1;30m\]. I am missing the entire point, ain't I? >Any chance for the idiots guide to what I am doing wrong here? :) >(man do I hate to seem this lost...) You can use two backslashes to represent one. example: "\[\033[1;30m\]" ==> "\\[\\033[1;30m\\]" This is of course assuming we are talking about character strings in Euphoria code. later, Lewis Townsend ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com
6. Re: Now for some actual euphoria/linux questions...
- Posted by Bernie Ryan <xotron at BUFFNET.NET> Apr 17, 2000
- 477 views
When the program sees \ ( the escape character ) in a text string, it looks at the next character following \ and expects it to have a special meaning, like \n it sees \ then sees the n which means to go to a new line. If the program sees \ followed by a character that has no special meaning then you will get an error so to tell the program that you really want to use the \ then you use \\ and the the program sees the first \ followed by another \ which has the special meaning to the program that you want to use the single slash \ Bernie
7. Re: Now for some actual euphoria/linux questions...
- Posted by Pete Eberlein <xseal at HARBORSIDE.COM> Apr 17, 2000
- 518 views
On Mon, 17 Apr 2000 15:45:10 -0400, Paul <draegur at WSERV.COM> wrote: >Pete Eberlein wrote: > >> >> >> kat already pointed out ANSI codes, and that's the way to go. >> http://www.linuxdoc.org/HOWTO/Bash-Prompt-HOWTO-6.html >> >> Pete Eberlein > >Well.. umm.. Did I happen to mention that I am slow? :) >I read the link and have seen the ansi tag codes, yet when I try to use them >in >Euphoria it errors with 'unknown escape character' after the initial \ in >codes such as >\[\033[1;30m\]. I am missing the entire point, ain't I? >Any chance for the idiots guide to what I am doing wrong here? :) >(man do I hate to seem this lost...) The trick is representing the escape character (ASCII 27 decimal, 033 octal) Since Euphoria doesn't support strings with octal escape codes, you have to do it with something like: 27&"[1;30m" Here's some graphics.e-ish code to print colors using ANSI: global constant BLACK = 0, BLUE = 1, GREEN = 2, CYAN = 3, RED = 4, MAGENTA = 5, BROWN = 6, WHITE = 7, GRAY = 8, BRIGHT_BLUE = 9, BRIGHT_GREEN = 10, BRIGHT_CYAN = 11, BRIGHT_RED = 12, BRIGHT_MAGENTA = 13, YELLOW = 14, BRIGHT_WHITE = 15 global procedure clear_screen() putc(1, 27) puts(1, "[2J") end procedure constant text_color_map = { "[0;30", "[0;34", "[0;32", "[0;36", "[0;31", "[0;35", "[0;33", "[0;37", "[0;1;30", "[0;1;34", "[0;1;32", "[0;1;36", "[0;1;31", "[0;1;35", "[0;1;33", "[0;1;37", "[1;7;40", "[1;7;44", "[1;7;42", "[1;7;46", "[1;7;41", "[1;7;45", "[1;7;43", "[1;7;47" } constant bk_color_map = { ";40m", ";44m", ";42m", ";46m", ";41m", ";45m", ";43m", ";47m", ";40m", ";44m", ";42m", ";46m", ";41m", ";45m", ";43m", ";47m", ";30m", ";34m", ";32m", ";36m", ";31m", ";35m", ";33m", ";37m" } integer textc, bkc textc = 16 bkc = 1 global procedure text_color(integer color) textc = color + 1 putc(1, 27) if bkc <= 8 or textc > 8 then puts(1, text_color_map[textc]) puts(1, bk_color_map[bkc]) else puts(1, text_color_map[textc+16]) puts(1, bk_color_map[bkc+8]) end if end procedure global procedure bk_color(integer color) bkc = color + 1 putc(1, 27) if bkc <= 8 or textc > 8 then puts(1, text_color_map[textc]) puts(1, bk_color_map[bkc]) else puts(1, text_color_map[textc+16]) puts(1, bk_color_map[bkc+8]) end if end procedure global procedure position(integer line, integer column) puts(1, 27) printf(1, "%d;%df", {line, column}) -- printf(1, "%d;%dH", {line, column}) end procedure ------------------------------------------------------- Hope this helps, Pete Eberlein
8. Re: Now for some actual euphoria/linux questions...
- Posted by Paul <draegur at WSERV.COM> Apr 17, 2000
- 489 views
Sooner or later I must get around to building that monument dedicated to you in the back yard.... Thanks much Pete!
9. Re: Now for some actual euphoria/linux questions...
- Posted by "Lucius L. Hilley III" <lhilley at CDC.NET> Apr 17, 2000
- 466 views
I knew the others where on the wrong track and obviously have no experience with ANSI codes. The were attempting to address the Euphoria error. Good job on the Euphoria error folks but to your dismay the issue was actually ANSI related not Euphoria. PS: This wasn't my hurdle to jump. A few of you had correct yet badly aimed answers. (not being sarcastic here) I greatly appreciate your attempts at solving the problem of our fellow Euphoria list member. Failed attempts are much better than no attempt at all. This is the kind of stuff that make be proud to be a Euphoria list member. !!! NOT the bickering and slander around and provided by Mike the Spike. Sincerely, Lucius L. Hilley III > ---------------------- Information from the mail header ----------------------- > Sender: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> > Poster: Pete Eberlein <xseal at HARBORSIDE.COM> > Subject: Re: Now for some actual euphoria/linux questions... > -------------------------------------------------------------------------- ----- > > On Mon, 17 Apr 2000 15:45:10 -0400, Paul <draegur at WSERV.COM> wrote: > <SNIP> > > > >Well.. umm.. Did I happen to mention that I am slow? :) > >I read the link and have seen the ansi tag codes, yet when I try to use > them > >in > >Euphoria it errors with 'unknown escape character' after the initial \ in > >codes such as > >\[\033[1;30m\]. I am missing the entire point, ain't I? >------------------------------------------------------- <SNIP> code that hits the spot. Provided by > Pete Eberlein >
10. Re: Now for some actual euphoria/linux questions...
- Posted by "Rev. Ferlin Scarborough" <ferlin at SANDW.NET> Apr 17, 2000
- 487 views
On Mon, 17 Apr 2000 15:11:09 -0400, Bernie Ryan <xotron at BUFFNET.NET> wrote: >When the program sees \ ( the escape character ) in a text string, > > it looks at the next character following \ and expects it to have a > > special meaning, like \n it sees \ then sees the n which means to go > > to a new line. If the program sees \ followed by a character that > > has no special meaning then you will get an error so to tell the > > program that you really want to use the \ then you use \\ and the > > the program sees the first \ followed by another \ which has the > > special meaning to the program that you want to use the single slash \ > > Bernie COOL, how you said that without stuttering!!!