Page 1 of 1

Syntax for wait

Posted: Tue Dec 01, 2015 4:31 am
by quailcreek
Hi,
I have a command in the stack script that does some checking and if there is an error it sends answer “there is a problemo.” The command is called be several cards in the stack from a preOpenCard handler. The problem is, because it’s call on preOpenCard, the answer dialog shows up before the card is displayed. I tried wait 1 sec but that didn’t work. Would wait until openCard work? I know I could just change to an openCard handler but I wanted to check with the forum first. Any suggestions would be appreciated.

Code: Select all

command GetContactName pContactID
   local tFullName
   
   if isNumber (pContactID) then
      put mobileGetContactData(pContactID) into theData[contact]
      if the result is an array then 
         if theData[contact]["middlename"] is empty then
            put theData[contact]["firstname"] && theData[contact]["lastname"]  into tFullName
         else
            put theData[contact]["firstname"] && theData[contact]["middlename"] && theData[contact]["lastname"]  into tFullName
         end if
         
         if theData[contact]["suffix"] is not empty then
            put comma && theData[contact]["suffix"] after tFullName
         end if
      else
         wait for something humma humma
         answer "The Contact could not be found. Contact may have been deleted." 
      end if
   end if
   return tFullName
end GetContactName

Re: Syntax for wait

Posted: Tue Dec 01, 2015 7:35 am
by snm
Use send command. Look for it in Dictionary.

Marek

Re: Syntax for wait

Posted: Tue Dec 01, 2015 9:37 am
by bn
What Marek said,

try either in your preopenStack handler

Code: Select all

put contactId into temp
send "getContackName temp" to me in 50 milliseconds
or move the call to getContactId to the openCard handler

Kind regards

Bernd