import System.*;
class Format
{
public static void main(String[] args)
{
Console.WriteLine("{0,5},{1,-5}","10","10");
}
}
Above program is good result like C#.( 10,10 )
But if I write 'Console.WriteLine("{0,5},{1,-5}",10,10);'
Console.WriteLine not support (string,int,int) <= error message
How use Console.WriteLine??
Thank you.
David Anton - 24 Aug 2005 15:51 GMT
You have to cast the int's to an object-derived .NET type. This is easily
one of the most annoying things about J# - but primitive types such as "int"
do not work seamlessly with their .NET counterparts such as an "Int32".
e.g.,
Console.WriteLine("{0,5}, {1,-5}", (Int32)10, (Int32)10);
Just as annoying is that although you have to jump through hoops to get .NET
methods to receive primitive types, the same .NET methods return primitive
types, so their results *can't* be assigned to a .NET type. Go figure...

Signature
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Clear VB: Cleans up outdated VB.NET code
Instant C#: Converts from VB.NET to C#
Instant VB: Converts from C# to VB.NET
Instant J#: Converts from VB.NET to J#
> import System.*;
>
[quoted text clipped - 14 lines]
>
> Thank you.