Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- return {a:"string 1", b:"string 2"}
- function func(a:String){
- a="newVal";
- }
- var b:String = "old";
- trace(b) // old
- func(b);
- trace(b) // old
- function Test(a:Object, b:Object):void {
- a = b;
- }
- funtion Test2():void {
- var s1:Sprite = null;
- var s2:Sprite = new Sprite;
- Test(s1,s2);
- Trace(s1);
- Trace(s2);
- }
- null
- [object Sprite]
- function Test(a:Object, b:Object):void {
- a = b;
- }
- var s1:Sprite = null;
- var s2:Sprite = new Sprite;
- Test(s1,s2);
- function passByRef(objParam:Object):void
- {
- objParam.x++;
- objParam.y++;
- trace(objParam.x, objParam.y);
- }
- var objVar:Object = {x:10, y:15};
- trace(objVar.x, objVar.y); // 10 15
- passByRef(objVar); // 11 16
- trace(objVar.x, objVar.y); // 11 16
Add Comment
Please, Sign In to add comment