Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
I need to search for the number of instance name and regarding on the number of intances I want to show (in this example 2) rows in a datagrid, that I can fill in with data.
on mouseUp
## I put your XML into field 1 of my little test stack
put fld 1 into tData
filter lines of tData with "*<instance name=*"
put the num of lines of tData
end mouseUp
inside a field, but i need pass the "f0" and "f1" on two lines in a datagrid.
So I guess I have to extract only what's inside the instance name="" into something?
tusa wrote: Thu Oct 26, 2017 7:01 am
but i need pass the "f0" and "f1" on two lines in a datagrid.
So I guess I have to extract only what's inside the instance name="" into something?
on mouseup
local tData, R
put line -16 to -2 of the script of me into tData
filter lines of tData with regex pattern "<instance name="
repeat for each line L in tData
if matchText( L, "\sname=.(.+?).\s", aNameValue) then
-- do whatever you like with aNameValue -> f0, f1,...
put "found: " & aNameValue &cr after R
end if
end repeat
put R
end mouseUp
/*
201 INFO TEMPLATE OK
<?xml version="1.0" encoding="utf-8"?>
<template version="2.0.0" authorName="Tue Sandbæk" authorEmail="tue@broadcastsupport.dk" templateInfo="TV SYD, KV17 credit" originalWidth="1920" originalHeight="1080" originalFrameRate="50">
<components>
<component name="CasparTextField">
<property name="text" type="string" info="String data"/>
</component>
</components>
<keyframes/>
<instances>
<instance name="f1" type="CasparTextField"/>
<instance name="f0" type="CasparTextField"/>
</instances>
<parameters/>
</template>
*/
There is, as often with LC, few ways to love a cat...
Hopefully, someone will come using offset (check in the dictionary)
HTH,
Thierry
! SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!