LiveCode Server with Stacks

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
turbolaserguy
Posts: 38
Joined: Thu Jul 04, 2013 1:29 pm

LiveCode Server with Stacks

Post by turbolaserguy » Wed Jul 17, 2013 5:35 pm

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?

turbolaserguy
Posts: 38
Joined: Thu Jul 04, 2013 1:29 pm

Re: LiveCode Server with Stacks

Post by turbolaserguy » Wed Jul 17, 2013 5:36 pm

typo:
Card 3

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: LiveCode Server with Stacks

Post by Klaus » Wed Jul 17, 2013 6:01 pm

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

turbolaserguy
Posts: 38
Joined: Thu Jul 04, 2013 1:29 pm

Re: LiveCode Server with Stacks

Post by turbolaserguy » Wed Jul 17, 2013 6:34 pm

Hi Klaus,

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: LiveCode Server with Stacks

Post by Klaus » Wed Jul 17, 2013 6:49 pm

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 :-)

turbolaserguy
Posts: 38
Joined: Thu Jul 04, 2013 1:29 pm

Re: LiveCode Server with Stacks

Post by turbolaserguy » Thu Jul 18, 2013 2:08 pm

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)

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: LiveCode Server with Stacks

Post by Klaus » Thu Jul 18, 2013 2:19 pm

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?

Post Reply