1. problems with procedures in while loop
- Posted by Jacen <pip at mail.sylvancomputers.com> Nov 28, 2004
- 529 views
For some reason, in only one of my games, it won't execute the procedure in my while loop below. When I trace it, it does get the input, and take the last character off, but won't execute the exec_cmd procedure. Any suggestions?
while 1 do input = gets(0) if sequence(input) then input = input[1..length(input)-1] exec_cmd(input) end if end while
2. Re: problems with procedures in while loop
- Posted by Patrick Barnes <mrtrick at gmail.com> Nov 28, 2004
- 540 views
On Sat, 27 Nov 2004 19:16:09 -0800, Jacen <guest at rapideuphoria.com> wrote: > in my while loop below. When I trace it, it does get the input, and take > the last character off, but won't execute the exec_cmd procedure. Any > suggestions? > > }}} <eucode> > while 1 do > > input = gets(0) > if sequence(input) then > input = input[1..length(input)-1] > exec_cmd(input) > end if > > end while > </eucode> {{{ So, if you do this: while 1 do input = gets(0) if sequence(input) then trace(1) input = input[1..length(input)-1] exec_cmd(input) end if end while It'll go into trace mode? What if you put trace(1) as the VERY FIRST statement in exec_cmd? (after variable declarations) -- MrTrick
3. Re: problems with procedures in while loop
- Posted by Jacen <pip at mail.sylvancomputers.com> Nov 28, 2004
- 521 views
The it won't trace at all. It's like it completely ignores the procedure, except if I use wrong syntax or an undeclared variable, it aborts like it should. Now I've made a copy of it, and created a backup folder, and instead of calling the procedure into my while loop, I've moved my while loop to the procedure, and now it works. But I still am using procedures in my backup file's while loop, and they work like normal. Go figure.
4. Re: problems with procedures in while loop
- Posted by Patrick Barnes <mrtrick at gmail.com> Nov 28, 2004
- 530 views
Is is possible that there's a different procedure that it's calling, rather than the one you expect? Make sure your 'with trace' is riiiiiiiight at the TOP of the program, before any include statements. On Sat, 27 Nov 2004 21:27:32 -0800, Jacen <guest at rapideuphoria.com> wrote: > > posted by: Jacen <pip at mail.sylvancomputers.com> > > The it won't trace at all. It's like it completely ignores the procedure, > except if I use wrong syntax or an undeclared variable, it aborts like it > should. Now I've made a copy of it, and created a backup folder, and instead > of calling the procedure into my while loop, I've moved my while loop to the > procedure, and now it works. But I still am using procedures in my backup > file's > while loop, and they work like normal. Go figure. > > > > > -- MrTrick