Updating a Card

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
Jayare
Posts: 12
Joined: Sat Apr 28, 2012 1:34 pm

Updating a Card

Post by Jayare » Fri Jun 08, 2012 10:10 am

Hello everyone,

i have a card, that has to be updated every time, the user gets to this card. Now i have tried prOpenCard and OpenCard, but this only runs once when the card is opened.

Is there any alternative to my code????

Greets
Jochen

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Updating a Card

Post by jmburnod » Fri Jun 08, 2012 10:37 am

Hi Jochen,

look at "pendingmessages" in the LC dictionary

Best regards

Jean-Marc
https://alternatic.ch

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

Re: Updating a Card

Post by Klaus » Fri Jun 08, 2012 11:11 am

Hi Jochen,
Jayare wrote:Hello everyone,
i have a card, that has to be updated every time, the user gets to this card. Now i have tried prOpenCard and OpenCard, but this only runs once when the card is opened
"pre-/opencard" seems to be the best place to do so!
What and where did you script?
Jayare wrote:Is there any alternative to my code?
Hm, can't tell without looking at your actual code! 8)


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Updating a Card

Post by dunbarx » Fri Jun 08, 2012 2:25 pm

Are you asking if it is possible to have a continuously running handler whenever the card is open? So that certain processes are executed at set intervals?

This is possible, with the "send in time" variant of the "send' command.

Usually such processes are handled whenever the user actually interfaces with card objects, for example, editing a field or moving an object. In other words, local scripts generally manage all user interaction. But your idea is interesting all by itself. Please write back with just a little more information about what you want to do.

Craig Newman

Jayare
Posts: 12
Joined: Sat Apr 28, 2012 1:34 pm

Re: Updating a Card

Post by Jayare » Fri Jun 08, 2012 2:34 pm

Hello everybody,

thanks for your replies. I want to run a script when the user gets to a specific card or stack.

The user can put in up to five articles in a sql database. Then my user gets to another stack where he can push buttons which are named like the articles in the first stack.

This operation is running:

databaseConnect_1  
put getDatabaseID() into tDatabaseID
revExecuteSQL tDatabaseID, tSQL
put databaseGetContactDetails() into button "kundennamen"
put databaseGetArtikelDetails() into tArtikel
put the number of lines of tArtikel into tlines
buttonaktualisieren
put line 1 of tArtikel into tArtikel1
set the label of button "Button1" to tArtikel1
put line 2 of tArtikel into tArtikel1
set the label of button "Button2" to tArtikel1
put line 3 of tArtikel into tArtikel1
set the label of button "Button3" to tArtikel1
put line 4 of tArtikel into tArtikel1
set the label of button "Button4" to tArtikel1
put line 5 of tArtikel into tArtikel1
set the label of button "Button5" to tArtikel1

I hope it gets clearer now.

Greets Jochen

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Updating a Card

Post by BvG » Sun Jun 10, 2012 4:13 pm

That should be either openCard, preOpencard openStack or preOpenStack, look them up in the dictionary, they do exactly what you want.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply