Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass By Reference in C#
#1
Hi Gintaras,

Does QM supports passing by reference using C#?

Example:
Macro PassByRef
Code:
Copy      Help
out
int a=1
int b=2
out "a=%i, b=%i" a b
CsFunc("" &a &b)
err
,out _error.description
out "a=%i, b=%i" a b

#ret
using System;

public class Test
{
,static public void PassByRef(ref int x, ref int y)
,{
,,x = 100;
,,y = 200;
,}
}
I've got this error:
a=1, b=2
0x80004002, No such interface supported.
Invalid cast from 'System.Int32' to 'System.Int32&'.
a=1, b=2


public (`fq)class(`) Test
{
(`i),(`)static public void PassByRef(`p)((`)(`fq)ref(`) (`t)int(`) x(`p),(`) (`fq)ref(`) (`t)int(`) y(`p))(`)
(`i),(`){
(`i),,(`)x (`o)=(`) (`n)100(`)(`p);(`)
(`i),,(`)y (`o)=(`) (`n)200(`)(`p);(`)
(`i),(`)}
}[/code]


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)