News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Assigning multiple return values to type fields doesn't work (PB1.63W10)

Started by thaaks, July 30, 2008, 04:21:16 AM

Previous topic - Next topic

thaaks

Coded from memory (wasn't online last night):

Type TAnything
  name$
  value
EndType

Dim Mine as TAnything
Mine = New TAnything

Mine.name$, Mine.value = TrickyFunction()

Function TrickyFunction()
  Local foo$, bar
; some smart stuff in here
  foo$ = "Hello"
  bar = 42
EndFunction foo$, bar


I receive some compiler error telling me that an "=" is expected in line

Mine.name$, Mine.value = TrickyFunction()


If I change the code to

Local n$, v
n$, v = TrickyFunction()
Mine.name$ = n$
Mine.value = v

everthing works as expected.

But the first code should work. Please tell me it's a bug and not just "unsupported"  ::)

Cheers,
Tommy

kevin


thaaks

You had to do that, right?  ;D

Any chance of getting that in? The work around with local variables is just a kludge IMO.