Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I'm wondering, when I want to write and read a view times with / to console if there is not a possibility to shortening my VB code like this:

 

with system.console

.writeline("...")

myVar = .readline()

.writeline(...)

myVar2 = .readline()

end with

 

That doesn't function. What functions is to seperate the blocks for read and write:

 

With System.Console.In

myVar = .ReadLine()

End With

 

With System.Console.Out

.WriteLine("...")

End With

 

But that's not what makes my code effective. Is there another way to do it more elegant :confused:???

 

Thank you for all answers.

  • *Experts*
Posted

Just add Imports System.Console at the very top of the class

or module that your console code is in. Then you can just use ReadLine

and WriteLine by themselves with no Console.Anything.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...