OutsideTheBox
asked on
proper syntax??
What is the proper syntax to use here?
How do I inject integers row & col into my statement to direct the code to increment which matrix variable it needs to display? (eg. myMatrix.M11, myMatrix.M12, myMatrix.M13, etc are fields within myMatrix)
for (int row = 1; i < 5; row++)
{
for (int col = 1; j < 5; col++)
{
frameFont.DrawText(null, Convert.ToInt16(MyMatrix.M row??? col??? ).ToString(), new Point(mStartHortz,mStartVe rt), Color.White);
mStartHortz += spH;
}
mStartVert += spV;
}
Thanks, Steve
How do I inject integers row & col into my statement to direct the code to increment which matrix variable it needs to display? (eg. myMatrix.M11, myMatrix.M12, myMatrix.M13, etc are fields within myMatrix)
for (int row = 1; i < 5; row++)
{
for (int col = 1; j < 5; col++)
{
frameFont.DrawText(null, Convert.ToInt16(MyMatrix.M
mStartHortz += spH;
}
mStartVert += spV;
}
Thanks, Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
frameFont.DrawText(null, Convert.ToInt16(MyMatrix.M [i][j]).To String(), new Point(mStartHortz,mStartVe rt), Color.White);
dZ..,
dZ..,
Boy, talk about the ultimate in bounds-checking! They must have done it that way either to eliminate bounds-checking for every element access or for memory effeciency since it's a value type (struct).
ASKER
seazium,
I tried both M[][] and myMatrix[i,j](ref your link) neithe works with the DirectX Matrix. (also, my for() statement was corrected for the obvius i/row, j/col issue)
oh well, as usual, writing 12 lines took less time than trying to make the above code work. My 12 lines work fine & I've moved on.
Thanks guys,
Steve
I tried both M[][] and myMatrix[i,j](ref your link) neithe works with the DirectX Matrix. (also, my for() statement was corrected for the obvius i/row, j/col issue)
oh well, as usual, writing 12 lines took less time than trying to make the above code work. My 12 lines work fine & I've moved on.
Thanks guys,
Steve
ASKER
there are 4 rows and 4 columns.
I can do it the long way I thought one statement would be clean. It is just for troubleshooting anyway, not for anything to be used.
No, not mine, it is a Microsoft class; Microsoft.Directx.Matrix
Programming with C++ using different DirectX classes it uses indexers (Matrix[][]) but in managed DirectX they do not.
Thank you,
Steve