LC Server & Server Based Stack?

Rick Harrison harrison at all-auctions.com
Sat Jan 21 10:47:31 EST 2017


Hi Mike,

This seems a little crazy to me.  

I can have two stacks open in memory in LiveCode, and I 
can send a message such as “mouseUp” from one stack 
to a button in the other stack. The button in the other stack 
outputs some messages to the message box and puts a 
message in a field on that stack and that all works just fine.
I’m able to view both stacks on the screen at the same time.
(This is as it should be.) 

I send the same message from the server to the button
and the messages which normally go into the message box 
end up in the display of my browser which seems a little strange but Ok
I can accept that.  The other message which was supposed to
go into the field never gets to the field which makes it look
like the button ignored that statement completely although
it executed everything else it was asked to perform.  That
message doesn’t seem to go anywhere as it doesn’t even
end up being displayed in the browser and ends up in the
bit bucket in the sky.  (Again, I can see the open stack
on the screen at the time that I tell my browser to execute
the server code.) Shouldn’t a message be a valid message
no matter where it comes from? (Hence my crazy feeling
about the whole thing.)

So you are telling me that I can send a message to closed
stack to modify it, that I should save it after the change, and
then reopen the stack to view the change - yes?

The file communication idea makes things a little more
complex but is certainly doable.

I’ve never done anything with sockets - are there any good
examples out there you can point me to for this?

Thanks,

Rick



> On Jan 20, 2017, at 10:20 PM, Mike Bonner via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> You can modify a stack using lc server, and save it, but that won't update
> an already open stack in memory.  And if you don't add code to save the
> stack from lc server, even if you do reload the stack, the change won't be
> there.
> 
> One way to update a field in an open stack would be to have the stack
> running a send in time loop that checks for changes to a file. (text file,
> or whatever)  If the last modified stamp has changed (or if the file
> exists, or however you want to do it)  read and parse the file, to get the
> info and put it wherever it goes then clear or delete the file.  You'd
> still have to think about concurrency issues, but it should work.
> the jacque standalone cgi method (as I mentioned in a different email)
> would be cool because you could hit the webserver, open a socket to your
> open stack to pass data from the server to the running stack.




More information about the use-livecode mailing list