HighTechTalks DotNet Forums  

What format?

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss What format? in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
c8prog
 
Posts: n/a

Default What format? - 08-23-2005 , 09:58 PM






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.


Reply With Quote
  #2  
Old   
David Anton
 
Posts: n/a

Default RE: What format? - 08-24-2005 , 09:51 AM






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...
--
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#


"c8prog" wrote:

Quote:
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.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.