Hi, and sorry for my question, it may be considered as a silly question but I’m in the fist approach and merging together Javascript into Pi still create some confusion to me.
I have created an array with 3 elements, and I cannot figure out how to extract the first, the second, the third element and so on.
I have created a pi Math where with a function I create an array, whose elements change thanks to an element selected form a selection box. Everything is working perfectly, if I put inside a field the output I receive the correct array - for example if I choose the first item the array has value [13,12,6], if I choose the second item the array changes into [17,33,20], and so on.
What I still don’t understand is how to get the first, or for example second element of this array, to isolate it and use it in another formula
I understand that the way is to access - for example the first item - is “name or array”[0], what I still cannot understand is how to refer to the array created in another pi stack
Sorry but I cannot understand… sigh!
I just know that stack “find-array” creates the right array for me, I cannot get first element of {{pi-find_array}} in this way. And I cannot figure out how i can write a function that get that from {{pi-find_array}}… any little help? …please!
Find array is invalid. You cannot store arrays inside Pi values. You would need to create a function that returns the first element of the found array. Basically it would return vettore[vet-1][0]. Then you would have another function that would return vettore[vet-1][1], etc if you needed that.
Thank you, thank you very much, I have changed completely the structure according to your suggestions. I had to triplicate the routines but now everything works. I have to say I have never found before a support system like yours, your personal involvement is admirable.
By the way: the original Find_array function seemed to work, the output of pi stack was (or seemed to be) an array
Hi Joe, I’d like to send you the project, what is the best way to do it?
I have finished the page, it’s basically an easy calculator, you can find it here:
Funny thing is that I cannot add any other function to the one I have already created… is there a limit in the functions that PI can treat in a single page?