|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
From the Blogosphere Writing to the Console in PowerBuilder 12.5 .NET
Why can’t a PB program directly write to the console in a displayable manner?
By: Yakov Werde
Nov. 3, 2011 10:00 AM
Yesterday I taught an intro to PowerBuilder .NET 12.5 session. Part of the presentation had me comparing the.NET IL code inside an assemblies generated from code written in C# and PowerBuilder. The C# code, after performing a simple arithmetic calculation echoed results to the console using these two lines of code namespace CalculatorExample In PowerScript, ordinarily, I echo results using a Messagebox call, but yesterday, I thought I'd "step out on the limb" and echo output to the console using the same NET Framework class methods C# programmers use. The equivalent PowerScript Code (slightly refactored) looks like this: n_calc Calc I opened a console window and ran the app from the command line The first run threw this exception:
Hmm, that's the ReadLine call. I removed that line and ran it again Hmm, no console output. Then a clever programmer suggested that I pipe the output to a text file and then type the file. Wow! Strange! What a trick! It worked! Here's the console output. You can plainly see that we did get results, but for some reason they didn't display to the console device. Only through outstream redirection was I able to capture the output.
I'd be mighty pleased if someone in engineering could explain this behavior. Why can't a PB program directly write to the console in a displayable manner? Why does ReadLine throw an exception? Reader Feedback: Page 1 of 1
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||