1. strange problem
- Posted by John McAdam <johnmcadam at clix.pt> Oct 24, 2001
- 343 views
Hmm.. that is bizarre. I'm working on a fairly small program and shouldn't be filling up memory - no large sequences or nested loops or huge numbers. Anyway this code works fine: puts(1,"R") printf(1,"%4d",like_table[4][1]) printf(1,"%3d",like_table[4][2]) printf(1,"%3d",like_table[4][3]) but this gives me a causeway error every time! printf(1,"R%4d%3d%3d",{like_table[4][1],like_table[4][2],like_table[4][3]}) Seems to me they are equivalent. Maybe the intepreter pushes one to many things onto some internal stack or something? I can use the first method but am wondering if my program is near collapse for some other reason?
2. Re: strange problem
- Posted by Ted Fines <fines at macalester.edu> Oct 24, 2001
- 337 views
I tried out what you described with this code: include misc.e sequence like_table like_table={{"one-a","one-b"}, {"two-a","two-b"}, {"three-a","three-b"}, {41,42,43,44,45,46}} puts(1,"R") printf(1,"%4d",like_table[4][1]) printf(1,"%3d",like_table[4][2]) printf(1,"%3d",like_table[4][3]) sleep(3) puts(1,"\n") printf(1,"R%4d%3d%3d",{like_table[4][1],like_table[4][2],like_table[4][3]}) sleep(10) ...and here's what I got, which seems good: R 41 42 43 R 41 42 43 I then replaced like_table[4] with: {"41","42","43","44","45","46"} ...and got this: R 52 52 52 (52 is the ascii code of '4') R 0 0 0 (not sure why these are zeroes) I tried both of these, as I wasn't sure what sort of data you were putting in like_table, and took a couple of guesses. But in neither case did I get a causeway error. This is EU2.2 on Win2000. It would seem that neither Eu nor your code is at fault. Have you tried a good ol' reboot? Got too many programs running? Ted --On Sunday, October 21, 2001 4:41 PM +0100 John McAdam <johnmcadam at clix.pt> wrote:rr > > Hmm.. that is bizarre. I'm working on a fairly small program > and shouldn't be filling up memory - no large sequences or > nested loops or huge numbers. > > Anyway this code works fine: > > puts(1,"R") > printf(1,"%4d",like_table[4][1]) > printf(1,"%3d",like_table[4][2]) > printf(1,"%3d",like_table[4][3]) > > but this gives me a causeway error every time! > > printf(1,"R%4d%3d%3d",{like_table[4][1],like_table[4][2],like_table[4][ > 3]}) > > Seems to me they are equivalent. Maybe the intepreter pushes > one to many things onto some internal stack or something? I > can use the first method but am wondering if my program is > near collapse for some other reason? > > > >