06-10-2015, 05:02 PM
Hi Gintaras,
Does QM supports passing by reference using C#?
Example:
Macro PassByRef
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]
Does QM supports passing by reference using C#?
Example:
Macro PassByRef
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;
,}
}
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]