Unreliable Cd ID of SubStacks ?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
pderks
Posts: 45
Joined: Sat May 14, 2011 4:25 pm
Location: Krefeld • Deutschland

Unreliable Cd ID of SubStacks ?

Post by pderks » Sat Apr 14, 2018 2:34 pm

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

bogs
Posts: 2202
Joined: Sat Feb 25, 2017 10:45 pm

Re: Unreliable Cd ID of SubStacks ?

Post by bogs » Sat Apr 14, 2018 4:11 pm

Which version of the IDE and which Os are you running?
Image

pderks
Posts: 45
Joined: Sat May 14, 2011 4:25 pm
Location: Krefeld • Deutschland

Re: Unreliable Cd ID of SubStacks ?

Post by pderks » 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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6155
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Unreliable Cd ID of SubStacks ?

Post by FourthWorld » Sun Apr 15, 2018 4:48 am

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
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bogs
Posts: 2202
Joined: Sat Feb 25, 2017 10:45 pm

Re: Unreliable Cd ID of SubStacks ?

Post by bogs » Sun Apr 15, 2018 7:50 am

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 :?
Image

pderks
Posts: 45
Joined: Sat May 14, 2011 4:25 pm
Location: Krefeld • Deutschland

Re: Unreliable Cd ID of SubStacks ?

Post by pderks » Mon Apr 16, 2018 12:09 pm

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

Post Reply

Return to “Talking LiveCode”