is it safe to catch only one VAR from return(a, b)?

Discuss any general programming issues here
Post Reply
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

is it safe to catch only one VAR from return(a, b)?

Post by Bugala »

I couldnt find this mentioned in documents, so here an example code:

Code: Select all

Function test()
	Local a = 1
	Local b = 2
	Return(a, b)
EndFunction

c = test()

DebugPrint("c:"..c)
Question is, is this a safe way to catch value of only "a" or should I always use something like: "c, d = test()" when returning two or more values at same time?
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: is it safe to catch only one VAR from return(a, b)?

Post by SamuraiCrow »

Additional return codes beyond what are received are ignored safely.
I'm on registered MorphOS using FlowStudio.
Post Reply