Missing Reference?

Jun 9, 2011 at 1:29 AM

Hey guys, I was experimenting converting int to uint and I found a code for it. Please help me fix this reference.

 

Reference Error:

System.Exception: Plug needed. System.String  System.Number.FormatDecimal(System.Decimal, System.String, System.Globalization.NumberFormatInfo)   at Cosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug)   at Cosmos.IL2CPU.ILScanner.ScanQueue()   at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod)   at Cosmos.Compiler.Builder.Builder.RunEngine(Object aParam)

Code Used:

  uint x = System.Convert.ToUInt32(Console.WindowHeight);           

  uint y = System.Convert.ToUInt32(Console.WindowWidth); 

 

Thanks - Matt

Coordinator
Jun 9, 2011 at 1:31 AM
On 6/8/2011 9:29 PM, civilwarrock wrote:
> Hey guys, I was experimenting converting int to uint and I found a code
> for it. Please help me fix this reference.
>
> Reference Error:
>
> System.Exception: Plug needed. System.String
> System.Number.FormatDecimal(System.Decimal, System.String,
> System.Globalization.NumberFormatInfo) at
> Cosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug)
> at Cosmos.IL2CPU.ILScanner.ScanQueue() at
> Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod) at
> Cosmos.Compiler.Builder.Builder.RunEngine(Object aParam)
>
> Code Used:
>
> uint x = System.Convert.ToUInt32(Console.WindowHeight);
>
> uint y = System.Convert.ToUInt32(Console.WindowWidth);

Converts are slower and many are left over from old VB.NET days. Use
casts instead.
Jun 9, 2011 at 1:48 AM

Thank you for the reply, ok so I should use casts then. Can you please show me how to do this. Thanks - Matt

Coordinator
Jun 9, 2011 at 1:51 AM
> Thank you for the reply, ok so I should use casts then. Can you please
> show me how to do this. Thanks - Matt

uint x = (uint)y
Jun 9, 2011 at 1:57 AM

Thank you so much. That helped me a ton. Yours Truly - Matt