joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2016
01:06 PM
multi-line statements in debugger?
Hello!
I'm trying to figure out if it is possible to nest an "if" inside a "for" in the debugger?
This works:
Now I want something like this
So far no matter what I've tried I get back
Tried these and more:
&
&
Anyone know how to do this, is it possible?
tyvmia
I'm trying to figure out if it is possible to nest an "if" inside a "for" in the debugger?
This works:
for each i in m.var: print i: end for
Now I want something like this
for each i in m.var
if i = "something"
? i
end if
end for
So far no matter what I've tried I get back
A block (such as FOR/NEXT or IF/ENDIF) was not terminated correctly. (compile error &hb5) in $LIVECOMPILE(256)
Tried these and more:
for each i in m.var : if i = "something" then ? i: end for
&
for each i in m.var : if i = "something" then ? i: end if : end for
&
for each i in m.var : if i = "something" : ? i : end if : end for
Anyone know how to do this, is it possible?
tyvmia
aspiring
4 REPLIES 4

speechles
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2016
01:46 PM
Re: multi-line statements in debugger?
items = ["one","two","three"]
? type(items)
for each i in items
if i <> ""
? i
end if
end for
roArray
one
two
three
Is type(m.var) always "roArray" or "roAssociativeArray"?

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2016
01:55 PM
Re: multi-line statements in debugger?
I would have thought the last attempt would have worked, but in my own tests I see it doesn't
So I dunno what can be done.
for each i in m.var : if i = "something" : ? i : end if : end for
So I dunno what can be done.
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2016
08:38 PM
Re: multi-line statements in debugger?
yeah, it won't work, since the parser makes assumptions - have to decide which form of `if` is used - and then it does not backtrack.
i think at some point i came with a very contrived way to accomplish something like the asked... except can't remember now. Ooops.
PS. Behold! I just devised you a new Rube Goldberg machine:
PPS. perhaps my old idea was
i think at some point i came with a very contrived way to accomplish something like the asked... except can't remember now. Ooops.
PS. Behold! I just devised you a new Rube Goldberg machine:
Brightscript Debugger> tbl = ["r", "a", "n", "d", "o", "m"]: for i = 0 to tbl.count()-1: ? {false:"", true: i.toStr() + chr(10)}[(tbl[i] > "m").toStr()]; : next
0
2
4
PPS. perhaps my old idea was
tbl = ["r", "a", "n", "d", "o", "m"]: for i = 0 to tbl.count()-1: while tbl[i] > "m": ? i: exit while: end while: next
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2016
09:19 AM
Re: multi-line statements in debugger?
"speechles" wrote:items = ["one","two","three"]
? type(items)
for each i in items
if i <> ""
? i
end if
end forroArray
one
two
three
Is type(m.var) always "roArray" or "roAssociativeArray"?
Thanks for the reply, but now accomplish the same in the DEBUGGER. I think Enterr got it, thanks guys!!
aspiring