Loop through Tag Annotations
Supriya Balaji
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 ?
String graphOrLayoutName // "" for top graph or layout
Variable showTag // 1 to show tags, 0 to hide tags
String list = AnnotationList(graphOrLayoutName)
Variable numItems = ItemsInList(list)
Variable i
for(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") == 0
if (isTag)
Tag /C/N=$name/W=$graphOrLayoutName /V=(showTag)
endif
endfor
End
You can demo it like this:
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)
August 6, 2013 at 06:54 pm - Permalink
August 7, 2013 at 12:58 pm - Permalink