Questions to resolve before purchasing Rev

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Questions to resolve before purchasing Rev

Post by jwbuzz » Tue Apr 13, 2010 8:13 pm

Hi guys.. I'm in the process of evaluating Rev for a couple of projects. I have a couple of questions I need to resolve before I can recommend that we purchase it.

1. I can't figure out how to call a message on a card from onMouseUp of a label on the card. I get this error but can't make much sense of if. Right now, the call is like this: call "transferFile" of "transfer_card"

field "lbl_track1": execution error at line n/a (Chunk: error in object expression) near "transfer_card", char 1


2. I created a timer by saying "send blah to me in 5 seconds" and then just repeating it. How can I stop a timer?

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

Re: Questions to resolve before purchasing Rev

Post by jmburnod » Tue Apr 13, 2010 8:26 pm

Hi jwbuzz,

Maeby you can try

Code: Select all

on mouseup
  transfer_card
end mouseup

on transfer_card
  -- what you want
end transfer_card
Best

Jean-Marc
https://alternatic.ch

jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Re: Questions to resolve before purchasing Rev

Post by jwbuzz » Tue Apr 13, 2010 8:29 pm

Thanks for the response.. I need to call the message in a different object because I have 8 buttons that need to call the same message. This is why I can't put the code in the script for the label field.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Questions to resolve before purchasing Rev

Post by bn » Tue Apr 13, 2010 8:36 pm

jwbuzz,
could you explain a little more where the buttons are (on the same card?) and where the handler for "transfer_card" is and what the label fields are supposed to do on top/besides the buttons. This all matters because by placing the "transfer_card" handler to the right place and using "the target" you could do all your message passing in one place.
jwbuzz wrote:How can I stop a timer?
Just add a condition. That could be a counter that is a script local variable

Code: Select all

local tCounter
on mouseUp
  put 0 into tCounter
  startMyTimer
end mouseUp

on startMyTimer
-- do your code here
  add 1 to tCounter
  if tCounter < 11 then
    send "startMyTimer" to me in 2 seconds
  end if
end startMyTimer
this could also be a time based condition like the seconds in a script local variable then test if the seconds - tSeconds > 60 then exit startMyTimer.

regards
Bernd

jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Re: Questions to resolve before purchasing Rev

Post by jwbuzz » Tue Apr 13, 2010 8:39 pm

Bernd.. Thanks for responding. I'm new so I'm not sure if my terminology is correct.. I don't have buttons. I have labels that I'm using as buttons. So.. I have my card (transfer_card) with 8 labels on it. When any of the 8 labels is clicked, I want to call transferFile on transfer_card.

jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Re: Questions to resolve before purchasing Rev

Post by jwbuzz » Tue Apr 13, 2010 8:41 pm

Ah.. I get it now. So I code onMouseUp in transfer_card instead of each individual button. Then how do I get info about which button was clicked?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Questions to resolve before purchasing Rev

Post by bn » Tue Apr 13, 2010 8:42 pm

jwbuzz,
the error you mentioned earlier is probably due to the fact that you left out card.

Code: Select all

call "transferFile" of card "transfer_card"
tell us if this helps

regards
Bernd

jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Re: Questions to resolve before purchasing Rev

Post by jwbuzz » Tue Apr 13, 2010 8:52 pm

Bernd... your last suggestion worked too. Thanks for the input. How do I know what label was clicked though?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Questions to resolve before purchasing Rev

Post by bn » Tue Apr 13, 2010 8:53 pm

jwbuzz,
jwbuzz wrote:Then how do I get info about which button was clicked?
if your label fields are on the card "transfer_card" and from what I see you numbered your label fields like "lbl_track1" then you could put into the card script:

Code: Select all

on mouseUp
   if the target contains "lbl_track" then
      put char - 1 of the short name of the target into tNumberOfField -- the number
      -- do what you want depending on the number of the field
      put tNumberOfField  -- this puts the number into the message box just to see it
   end if
end mouseUp
mind you: no mouseUp handler in the label fields, just name them in a way for the handler in the card script to work with them.
If you have more then 9 label fields you would have to adapt the script. Just ask if it is unclear.
regards
Bernd

jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Re: Questions to resolve before purchasing Rev

Post by jwbuzz » Tue Apr 13, 2010 9:21 pm

Thanks a lot.. Is there no documentation on what to do with the target? For example, I want to get the value of the label instead of the name of the field. I'm used to being able to look stuff like this up in PHP but can't find how to look this up here.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Questions to resolve before purchasing Rev

Post by bn » Tue Apr 13, 2010 9:36 pm

jwbuzz,

Code: Select all

on mouseUp
   put the short name of the target into tShorNameOfTarget
   if tShorNameOfTarget contains "lbl_track" then
      put char - 1 of the short name of the target into tNumberOfField

      put the text of field tShorNameOfTarget into tLabel -- here is the label = text of the label field
      -- do what you want depending on the label of the field

      put the text of field tShorNameOfTarget of this card -- just to show it in the message box
   end if
end mouseUp
Well the label of a label field is the text of a label field.
regards
bernd
jwbuzz wrote:Is there no documentation on what to do with the target?
look at the pdf user guide. Not bad at all.

jwbuzz
Posts: 39
Joined: Tue Apr 13, 2010 7:56 pm

Re: Questions to resolve before purchasing Rev

Post by jwbuzz » Tue Apr 13, 2010 9:44 pm

Ok.. I started out in the user guide but abandoned it because I couldn't find some things.. I'll go back to it for stuff like this. Thanks for the help. This forum is really good.

Post Reply