Access SB List from Javascript?

Using Javascript from SpiderBasic
Andy
Posts: 46
Joined: Sat Feb 15, 2020 5:19 pm
Location: Larnaca, Cyprus
Contact:

Access SB List from Javascript?

Post by Andy »

Hi, i have a structure that contains an array as one of its element. I need to access this array from javascript code. I can access an array directly using !a_arrayname. How can we get the array contents in a list from javascipt?

Thanks
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Access SB List from Javascript?

Post by Peter »

Code: Select all

Structure myStructure
  Array myArray.s(0)
EndStructure

Define myStructuredVar.myStructure

Debug myStructuredVar\myArray(0) ; -> v_mystructuredvar._myArray.array[0];
Andy
Posts: 46
Joined: Sat Feb 15, 2020 5:19 pm
Location: Larnaca, Cyprus
Contact:

Re: Access SB List from Javascript?

Post by Andy »

nice :)

i was looking at the debugger and found

Code: Select all

t_mystructure.current._mydata.array[v_arrayindex]
Post Reply