Close Card preOpenCard precedence ???BUG??

Hershel Fisch hershrev at realtorsgroup.us
Mon Aug 15 14:32:00 EDT 2005


On 8/15/05 1:03 PM, "Hershel Fisch" <hershrev at realtorsgroup.us> wrote:
As you could see below I added the "wait for 75 milisecs" in the
"putDataIntoFlds" handler and that got it to work. That is the least that
did it.
And I took out all path's meaning I put all below in every card script and
it only worked with the wait for 75 mile and more.
Now I'm convinced that's some kind of bug, Sorry
Hershel

> On 8/13/05 1:19 AM, "J. Landman Gay" <jacque at hyperactivesw.com> wrote:
> 
>> 
>> If you are testing on the first card of your stack, that stack won't get
>> any "closecard" message when the stack first opens. If you are testing
>> after the stack is already open or from a different card, then you
>> should get a closecard each time. Could the problem be that you are
>> trying to do something when the stack first opens?
I'll try to give the code I'm using.

On closeCard
  hEmptyFlds
End closeCard


on hEmptyFlds
   repeat with x = 1 to the number of flds
    if the name of fld x contains "zzzL" is false  then put empty into fld x
  end repeat
end hEmptyFlds

on preOpenCard
  set the label of this stack to the short name of this cd
  if gAction <>"new" then
    put  the uQuery of this cd   & "'" & \
    the uSelectedPk of this stack & "'" into tQ
    put revDataFromQuery(,,gDbid,tQ) into pData
    if pData contains "error" then
      answer tQ & return & pData
    end if
    hPutDataIntoFlds pData --,the uCount of this stack
    hSetBtnLabel
    set the uQueryResult of this cd to  pData
  end if
end preOpenCard



on hPutDataIntoFlds pData,pItem
  set itemDelimiter to tab
  put 1 into y
  if pItem is empty then put 1 into pItem
  wait for 75 millisecs
  repeat with x = pItem to the number of flds
    if the short name of field x contains "zzzL" is false then
      put item y of pData into field x
      add 1 to y
    end if
    if the mouse is down then exit repeat
  end repeat
end hPutDataIntoFlds




More information about the use-livecode mailing list