I have code like this to show me the StackTrace from an exception I'm getting:
catch (Exception x)
{
MessageBox.Show(string.Format("Booboo ({0}) in buttonGetDeviceLangVal_Click(). StackTrace == {1}",
x.Message, x.StackTrace));
}
...but I cannot see the entire communique from the bowels of the puny confounded contraption (handheld device) due to the real estate constraints; I cannot drag the MessageBox higher - it bumps its head against the top and refuses to make a hole in the roof so that I can see the rest of the story.
So how can I get the MessageBox to split the string into "episodes" that I can cycle through?
My idea (pseudocode) is something like this:
catch (Exception x)
{
const int MAX_CHARS_TO_SHOW = 314;
string exmsg = string.Format("Booboo ({0}) in
buttonGetDeviceLangVal_Click(). StackTrace == {1}",
x.Message, x.StackTrace);
int msglen = exmsg.Len;
int charsDisplayed = 0;
while (charsDisplayed < msglen) do
{
string exmsgepisode = String.Copy(exmsg, charsDisplayed, MAX_CHARS_TO_SHOW);
MessageBox.Show(exmsgepisode);
charsDisplayed += charsDisplayed;
}
}
...but I reckon somebody "out there" has a better idea or has already solved this...did I reckon right?