To answer the question in great detail:

It always looked as though the script code was run inside a Subroutine
from within the script editor. So you'd expect the Return statement to
work. However, this was a lie. When the script was compiled it ended
up inside a function that had a boolean return value.

I changed this in 0.6, so now you really are inside a Sub. You can
return whenever you want and when you return it will no longer short-
circuit the output assignment (as it did < 0.6).

--
David Rutten
[email protected]
Robert McNeel & Associates




On Mar 24, 8:11 pm, oompa_l <[email protected]> wrote:
> oh wait, nevermind. I just realised that each one had the false in two
> spots, not just one. my bad
>
> On Mar 24, 2:37 pm, Rajaa <[email protected]> wrote:
>
> > Hi,
>
> > Just remove "False" in the first line of the code.  Subs are not
> > supposed to return a value.  I know older version was more relxed
> > about this and this why it worked.
>
> > You can't run 2 versions of GH at the same time.  A link to the older
> > version is here if you like to roll back:http://grasshopper.rhino3d.com/
>
> > On Mar 24, 1:29 pm, oompa_l <[email protected]> wrote:
>
> > > hi
>
> > > some really simple vb stuff that was working before,is now not
> > > working...and I have no idea why
>
> > > here's the code:
>
> > >   Sub RunScript(ByVal path As String)
>
> > >     If (Not IO.File.Exists(path)) Then Return False
>
> > >     Dim lines As String() = IO.File.ReadAllLines(path)
> > >     If (lines Is Nothing) Then Return False
>
> > >     Dim pts As New List(Of On3dPoint)
> > >     Dim labels As New List(Of String)
> > >     Dim radii As New List(Of Double)
>
> > >     'Dim temperature As New List(Of Color
> > >     'Dim humidity As New List(Of String)
>
> > >     For Each line As String In lines
> > >       Dim parts As String() = line.Split(",".ToCharArray())
>
> > >       Dim x As Double = Convert.ToDouble(parts(0))
> > >       Dim y As Double = Convert.ToDouble(parts(1))
> > >       Dim z As Double = Convert.ToDouble(parts(2))
> > >       Dim radius As String = Convert.ToString(parts(3))
> > >       Dim label As String = Convert.ToString(parts(5))
>
> > >       pts.Add(New On3dPoint(x, y, z))
> > >       radii.Add(radius)
> > >       labels.Add(label)
> > >     Next
>
> > >     A = pts
> > >     B = labels
> > >     C = radii
> > >   End Sub
>
> > > I am getting error message about "Return statement in a 'sub' or 'set'
> > > cannot return a value."
>
> > > Also, is it possible to go back to an earlier version of grasshopper?
> > > Are the old ones still available? Can we have multiple versions
> > > installed at the same time?
>
> > > thanks!

Reply via email to