Page 1 of 1

LiveCode Server with Stacks

Posted: Wed Jul 17, 2013 5:35 pm
by turbolaserguy
Now LiveCode CGI without Stacks are working, I started to try to create CGI using stacks.
The stack is a simple database stack with one background field called MyField.
MyDatabase.lc is as follows:

<?lc
set the errorMode to "inline"
?>
<html>

<head>
<title>My LiveCode Database Test Page</title>
</head>

<body>
<h1>My LiveCode Database Test Page</h1>
<?lc
go stack "MyDatabase.livecode"
put "<p>Card 1</p>"
put "<br>" & card field "MyField" & "</br>" & crlf
put "<p>Card 2</p>"
go next
put "<br>" & card field "MyField" & "</br>" & crlf
put "<p>Card 2</p>"
go next
put "<br>" & card field "MyField" & "</br>" & crlf

?>
</body>

</html>

I saved it and typed the URL of the CGI in Safari, but the loading stops. It doesn't respond. Any suggestions?

Re: LiveCode Server with Stacks

Posted: Wed Jul 17, 2013 5:36 pm
by turbolaserguy
typo:
Card 3

Re: LiveCode Server with Stacks

Posted: Wed Jul 17, 2013 6:01 pm
by Klaus
Hi turbolaserguy,

I am not sure that you can actually "GO" to a stack with LC server?

My understanding is that you can currently only use stacks as (script-)libraries:
...
<?lc
start using stack "my_library.livecode"
?>
...

I may be wrong :-)


Best

Klaus

Re: LiveCode Server with Stacks

Posted: Wed Jul 17, 2013 6:34 pm
by turbolaserguy
Hi Klaus,

See "Go Stack" section of
http://lessons.runrev.com/s/lessons/m/4 ... 4082219038

Re: LiveCode Server with Stacks

Posted: Wed Jul 17, 2013 6:49 pm
by Klaus
Ah, I see, but I think is just an alternative way of loading the stack as a library.

And it obviously does not work for you the way you exspect it :-)

Re: LiveCode Server with Stacks

Posted: Thu Jul 18, 2013 2:08 pm
by turbolaserguy
Klaus,

No, no! If you go to stacks in CGI, you can use the background field values as card-based database! You don't need SQL. I've done it before (about 4 years ago) on RunRev server! (I lost the code I wrote in that day)

Re: LiveCode Server with Stacks

Posted: Thu Jul 18, 2013 2:19 pm
by Klaus
Ah, OK, did not know this! But then your original script should work, right!?

Maybe you could add a TRY stucture to your code and see if there is an error of any kind?
All of the file permissions are correct on the server?