Variable scope in Server mode

Richard Gaskin ambassador at fourthworld.com
Wed Aug 28 12:29:35 EDT 2013


Christer Pyyhtiä wrote:

 > -  when you connect the server, and set a global variable into
 > a value (e.g. put "true" into gVar),  and your device after a
 > few commands contacts the server / same script again, is gVar
 > still "true" or empty?

Any CGI process is launched, runs, and quits with each request.

So with LC Server, any variables initialized will be gone once the 
request returns to Apache.

If you need persistence you can use text files or a database, of if the 
data is user-specific you can use LS Server's session support.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys





More information about the use-livecode mailing list