On Sun, Mar 23, 2014 at 8:24 PM, Raul Miller <[email protected]> wrote: > After reading a bit more of you code, I need to change some of the details > of my suggestions. > > Immediately above your definition of 'paint' in tgsjhs.ijs you have: > > ev_command_enter=: 3 : 0 > ". s=. getv 'command' > ) > > At the bottom of your 'paint' definition you have the line: > jhrajax linecolors,JASEP,lines,temp > > What I am proposing is that you store these values (linecolors, lines, > temp) in your tgsj locale. You will have to change things slightly, so that > paint can run multiple times. And then run the modified jhrajax from > ev_command_enter. > > Perhaps something like this: > > ev_command_enter=:3 :0 > PENDING=:'' > ". s=. getv 'command' > jhrajax PENDING > ) > > And then in 'paint' you would append data to PENDING. >
Raul - I agree with you. I was trying to make that point more generally without having looked at the code. Now that I have also reviewed the code, I completely agree. Generally again: It looks like Brian is using some code that expects to be able to update the screen per turtle move. This is common in desktop applications. Brian's JHS code replaced the paint operation, with logic to create an array of data for painting instead of doing the actual paint operation. The JHS paint operation calls jhrajax which results in the HTTP result being sent and the signalling the end of the operation. Basically, it sends the HTTP response headers and the content so the client thinks the operation is over. But, there can be more than one 'paint' triggered. So the only possible approach is to have the paint operations append to local variables while they are evaluated and then send the local variables as one jhrajax. Raul's suggestion would work well in my opinion. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
