Set and get dgData and dgText delay
Sean Cole (Pi)
sean at pidigital.co.uk
Thu Mar 25 11:24:40 EDT 2021
I’ve tried using wait, wait with messages, wait until. No joy.
But in a separate test stack with the same data it works just fine having
them one after the other.
There is no sense to it NOT passing the text one line to the next.
I thought it might be because it was located in a preOpenCard script but
moving it into the openCard or even 0sec after the open card in another
handler made no difference.
The real issue here is that the same stack worked ok before so there is
something we have done that upset it. I’m just going to have to pick my way
through till I find what is preventing the Dg from carrying out its
function. In the background.
On Thu, 25 Mar 2021 at 14:45, Richard Gaskin via use-livecode <
use-livecode at lists.runrev.com> wrote:
> The difference between the working and non-working examples seems to be
> limited to the introduction of a delay in the working one, between
> setting the dgData array and later obtaining its text.
>
> Since the array form is what the DG uses internally, perhaps something
> during loading of that array or rendering the UI needs the "wait 0", and
> what you're seeing is a side effect of that internal need.
>
> Being scripted in LC, the DG code could be examined for "wait" or "send"
> to see what's up.
>
> But while the exploration may be fun it would likely be inconsequential,
> since given the general quality of Trevor's work the delay is probably
> not a mistake, but a necessity. That is, you'd learn WHY you need the
> delay, but you'd still need it.
>
> If you do go spelunking in the DG source please let us know what you find.
>
> But now that you've found the solution it may be just as well to use it
> and move on with what you're building.
>
> --
> Richard Gaskin
> Fourth World Systems
>
>
>
>
> Sean Cole wrote:
>
> > Thanks Craig
> >
> > This could make some sense. There are a lot of handlers to deal with. I
> > thought I was going a bit mad. I’m just going to have to pick my way
> > through.
> >
> > On Thu, 25 Mar 2021 at 12:44, Craig Newman via use-livecode <
> > use-livecode at lists.runrev.com> wrote:
> >
> >> I have seen this here and there for years, and having nothing to do with
> >> dataGrids per se.
> >>
> >> A handler will fail to run, but will step through in the debugger
> without
> >> issue. This usually resolves, and I never know why.
> >>
> >> Craig
> >>
> >> > On Mar 24, 2021, at 5:09 PM, Pi Digital via use-livecode <
> >> use-livecode at lists.runrev.com> wrote:
> >> >
> >> > Hi All
> >> >
> >> > This has been a bit of a mind bender, mainly because in a test stack
> it
> >> works just fine, but...
> >> >
> >> > Has anyone ever had problems with something like this:
> >> >
> >> > on myHandle
> >> > — ...some code
> >> > Set the dgData of grp “myDG” to tDataA
> >> > Put the dgText of grp “myDG” into tDataS
> >> > — tDataS returns empty
> >> > — process tDataS...
> >> > end myHandle
> >> >
> >> > And this:
> >> >
> >> > on myHandle
> >> > — ...some code
> >> > Set the dgData of grp “myDG” to tDataA
> >> > dispatch “myHandlePt2”
> >> > end myHandle
> >> >
> >> > on myHandlePt2
> >> > Put the dgText of grp “myDG” into tDataS
> >> > — tDataS returns empty
> >> > — process tDataS...
> >> > end myHandlePt2
> >> >
> >> > However, this works:
> >> >
> >> > on myHandle
> >> > — ...some code
> >> > Set the dgData of grp “myDG” to tDataA
> >> > send “myHandlePt2” to me in 0 sec
> >> > end myHandle
> >> >
> >> > on myHandlePt2
> >> > Put the dgText of grp “myDG” into tDataS
> >> > — tDataS returns empty
> >> > — process tDataS...
> >> > end myHandlePt2
> >> >
> >> >
> >> > It seemingly doesn’t have anything to do with data length. I’ve tried
> >> forcing a refresh of the grid using dispatch refreshList to it but that
> >> makes no difference. Stepping through in the debugger allows it to work
> or
> >> setting a breakpoint, but does not when in full run. Both in standalone
> and
> >> ide.
> >> >
> >> > A one have any clues why this might not work sometimes?
> >> >
> >> > Thanks
> >> >
> >> > Sean Cole
> >> > Pi Digital
> >> > eMail Ts & Cs
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
--
Pi Digital
More information about the use-livecode
mailing list