OK, I don't have a tendency to help people that are hard-headed but for the
sake of my sanity, here's *A* sample...
(c# because I don't even know how to write a constructor in vb.ner despite
using VB exclusively for nearly 10 years)
using System;
namespace CobolSample
{
public class Person
{
int fnStart, fnLength, lnStart, lnLength;
private string mFirstName;
private string mLastName;
public Person(string NameBuffer)
{
switch ( NameBuffer.Length )
{
case 20:
fnStart = 0;
fnLength = 10;
lnStart = 10;
lnLength = 10;
break;
case 40:
fnStart = 0;
fnLength = 20;
lnStart = 20;
lnLength = 20;
break;
case 60:
fnStart = 0;
fnLength = 30;
lnStart = 30;
lnLength = 30;
break;
default:
throw new Exception("Invalid Name Buffer Length!");
break;
}
mFirstName = NameBuffer.Substring(fnStart, fnLength).Trim();
mLastName = NameBuffer.Substring(lnStart, lnLength).Trim();
}
public string FirstName
{
get { return mFirstName; }
set { mFirstName = value; }
}
public string LastName
{
get { return mLastName; }
set { mLastName = value; }
}
public string NameBuffer
{
get
{
return String.Format("{0,-" + fnLength.ToString() + "}{1,-"
+ lnLength.ToString() + "}", mFirstName, mLastName);
}
}
public string FullName
{
get
{
return mFirstName + " " + mLastName;
}
}
}
}
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com