Fixes you'll need to get it to work

Apr 29, 2008 at 12:55 AM
Edited Apr 29, 2008 at 12:58 AM
Hi all, for your reference, here are a bunch of fixes i had to do to get this library to work for me:

comment out the 'using System.Runtime.Serialization.Formatters.Soap;' line

Line ~181:
replace "mScreenRows[i] = text;"
with: "if (i>=0 && i< mScreenRows.Length) mScreenRows[i] = text;"

line ~197:
replace "mScreenBuffer[*_CX] = ch;"
int off = chindex + field.Location.left + * _CX;
if (off >= 0 && off < mScreenBuffer.Length)
mScreenBuffer[*_CX] = ch;

Lines ~145 and 146:
Change to:
seq_number[0] = buf[3];
seq_number[1] = buf[4];

Apr 30, 2008 at 12:28 AM
Edited Apr 30, 2008 at 12:28 AM
Another bug fix:

Line ~155
Change from:
mScreenRows[i] = " -- really long empty string here -- ".Substring(0, _CX);
Change to:
mScreenRows[i] = new String(' ',_CX);
Apr 30, 2008 at 12:50 AM
And another one: (this allows it to work at higher than 80x25 mode)

TnXmlScreen.cs, around line 310

Change from:
stream.WriteLine(" 0 1 2 3 4 5 6 7 ");
stream.WriteLine(" 012345678901234567890123456789 ....");

Change to:

string tens = " ", singles= " "; // the quoted strings must be 3 spaces each, it gets lost in translation by codeplex...
for (i = 0; i < _CX; i += 10)
tens += String.Format("{0,-10}", i / 10);
singles += "0123456789";
stream.WriteLine(singles.Substring(0, 3 + _CX));

Please someone fork this project quickly so we can integrate all these fixes, they're so basic.
Apr 30, 2008 at 1:16 AM
And another two - i think this'll be the last for a while, as everything seems to be working nicely now (finally!)
This fixes the problem where the host would choke on trying to send too many rows.

TN3270E\X3270\Stuff\Ctlr.cs, around line 241
Change to:
public int maxROWS = 43; // (used to be 100)

Having said that, there's a function 'setrowscols' in there that seems to be relevant, but it doesn't get called by anything.

Next one: This fixes the screen so its got enough space for whatever the host can send:
TnXmlScreen.cs, around line 131:
Change to:
_CX = 132; // Changed by CHRIS from 80
Apr 30, 2008 at 3:25 PM
We do appreciate your input.

The following are some suggestions:
The max rows/cols should be moved to the configuration parameters. There are comments (by mike?) about this in the code. He hard coded most things to use 25x80.
Please add explanations for all bug fixes and how you propose to fix them, so that people can understand the purpose of the way they are being fixed. This will be useful when the project fork is done and we are trying to determine what the problems are and the fixes to them (as well as how to fix).

Again, all input is welcome (very much so). It is because of people being willing to share that many of the open source projects world-wide are so successful.
Thank you.