Page 1 of 1

Unreliable Cd ID of SubStacks ?

Posted: Sat Apr 14, 2018 2:34 pm
by pderks
Hi,

since time immemorial I use

Code: Select all

lock screen
  put the Long ID of this cd into CdID
  go stack XX
  -- do something
  put the Number of this cd into CdNu
  go CdID
Today I a put this script into a button of a substack "B" of stack "A":

Code: Select all

on FetchCdNum StackChoice
  lock screen
  put the Long ID of this cd into CID
  go stack StackChoice
  put the Number of this cd into CdNu
  go CID
  select line CdNu of fld "ToC" -- of stack "B" -- of stack "A"
  unlock screen
end FetchCdNum
and get this error message: stack "B": execution error at line 42 (Chunk: no such object), char 1.

If I remove the first "--" in line 7 of script 2 I get the wanted result.

Regards

Peter

Re: Unreliable Cd ID of SubStacks ?

Posted: Sat Apr 14, 2018 4:11 pm
by bogs
Which version of the IDE and which Os are you running?

Re: Unreliable Cd ID of SubStacks ?

Posted: Sun Apr 15, 2018 3:37 am
by pderks
Hi bogs,

I run a Mac Pro mid 2012 with macOS Sierra 10.12.6 and LiveCode 9.0.0 build 15017.

Thanks for your interest.

Peter

Re: Unreliable Cd ID of SubStacks ?

Posted: Sun Apr 15, 2018 4:48 am
by FourthWorld
pderks wrote:
Sat Apr 14, 2018 2:34 pm

Code: Select all

on FetchCdNum StackChoice
  lock screen
  put the Long ID of this cd into CID
  go stack StackChoice
  put the Number of this cd into CdNu
  go CID
  select line CdNu of fld "ToC" -- of stack "B" -- of stack "A"
  unlock screen
end FetchCdNum
FWIW you don't need to go to a card to get its properties, e.g.:

Code: Select all

on FetchCdNum StackChoice
  return the number of this cd of stack StackChoice
end FetchCdNum

Re: Unreliable Cd ID of SubStacks ?

Posted: Sun Apr 15, 2018 7:50 am
by bogs
pderks wrote:
Sun Apr 15, 2018 3:37 am
Hi bogs,
I run a Mac Pro mid 2012 with macOS Sierra 10.12.6 and LiveCode 9.0.0 build 15017.
Thanks for your interest.
Peter
Ah well, I can't simulate it :? I was going to take a running pass at seeing if I could but 10.6.3 is the end of OSX line for me, and I couldn't get 9 to run in it after installing heh :?

Re: Unreliable Cd ID of SubStacks ?

Posted: Mon Apr 16, 2018 12:09 pm
by pderks
Hi Richard,

thank you very much for that fine stratagem. Now I can finish my central ToC stack, which shows the card list of the current MouseStack and hilites the line of its recent card.

Best regards

Peter