问题描述
不知道如何为在ActionScript 3从函数返回多个变量?
任何像VB.NET,你可以有在输入参数的变量修改(为ByRef参数)?
子做的(为ByRef INOUT作为整数)
INOUT * = 5;
结束小组
昏暗的NUM为整数= 10
的Debug.WriteLine(NUM)'10
做(NUM)
的Debug.WriteLine(NUM)'50
任何除了返回一个关联数组
返回{一:串1,B:字符串2}
在AS3一切都是参考除了[U]整数。一概而论,一切都继承对象
将通过参考赋予的功能。
话虽这么说,我相信你能做到的唯一方法是使用一个容器类像阵列
或字符串
(5,并进行转换+数学)。
Any idea how to return multiple variables from a function in ActionScript 3?
Anything like VB.NET where you can have the input argument's variable modified (ByRef arguments)?
Sub do (ByRef inout As Integer)
inout *= 5;
End Sub
Dim num As Integer = 10
Debug.WriteLine (num) '10
do (num)
Debug.WriteLine (num) '50
Anything apart from returning an associative array?
return {a:"string 1", b:"string 2"}
Everything in AS3 is a reference aside from [u]ints. To generalize, everything that inherits Object
will be given to the function by a reference.
That being said, the only way I believe you can do it is use a container class like an Array
or a String
("5" and do the conversion+math).
这篇关于你能有和QUOT;为ByRef"在AS3中函数的参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!