Re: Sequence depths please explain

new topic     » goto parent     » topic index » view thread      » older message » newer message

try this:

type nested(sequence x)
	for i = 1 to length(x) do
		if sequence(x[i]) then return 1 end if
	end for
	return 0
end type

or swap return 0 & 1 and call it simple()

I recommend making it a type solely because it traps better when you
know something should be simple, not nested, or vice versa.

You can still just say, on any object,:

	if nested(thingy) then

or

	if simple(thingy) then


Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu