How do you create a loop that will change the text box name with every iteration?
For example, I have a graph with 80 tags annotated on it. Each tag has a text name, namely text0 through text79. How do I increment from text0 to text79 in steps of 1 ?
Function Demo(graphOrLayoutName, showTag)String graphOrLayoutName // "" for top graph or layoutVariable showTag // 1 to show tags, 0 to hide tagsString list = AnnotationList(graphOrLayoutName)Variable numItems = ItemsInList(list)Variableifor(i=0; i<numItems; i+=1)String name = StringFromList(i, list)String info = AnnotationInfo(graphOrLayoutName, name)String typeStr = StringByKey("TYPE", info, ":")Variable isTag = CmpStr(typeStr,"tag") == 0if(isTag)Tag/C/N=$name/W=$graphOrLayoutName/V=(showTag)endifendforEnd
You can demo it like this:
Make jack=sin(x/8)Display jack
Tag/C/N=text0/L=2 jack, 20,"text0"Tag/C/N=text1/L=2 jack, 40,"text1"Tag/C/N=text2/L=2 jack, 60,"text2"
Demo("", 0)
Demo("", 1)
You can demo it like this:
August 6, 2013 at 06:54 pm - Permalink
August 7, 2013 at 12:58 pm - Permalink