1

i did this and its working slightly better, now i get the error: 45 / 44 matric.pas Fatal: Syntax error, ) expected but const char found It is probable because i am using pascal graph.

program MatrixArray;
Uses wincrt,graph;
Var
GraphicsDriver, GraphicsMode: Smallint;
Xaxis: array[1..10] of string;
Yaxis: array[1..10] of string;
Matrix: array[1..10,1..10] of string;
x:integer;
y:integer;
{two var's are needed for initialisation}
Begin
Writeln('Loading Game Graphics...');
GraphicsDriver := Detect;
InitGraph(GraphicsDriver, GraphicsMode,'');
ClearViewPort;

declaring the arrays

Xaxis[1] :='A';
Xaxis[1] :='B';
Xaxis[1] :='C';
Xaxis[1] :='D';
Xaxis[1] :='E';
Xaxis[1] :='F';
Xaxis[1] :='G';
Xaxis[1] :='H';
Xaxis[1] :='I';
Xaxis[1] :='J';

Yaxis[1] :='1';
Yaxis[1] :='2';
Yaxis[1] :='3';
Yaxis[1] :='4';
Yaxis[1] :='6';
Yaxis[1] :='7';
Yaxis[1] :='8';
Yaxis[1] :='9';
Yaxis[1] :='10';

for x := 1 to 10 do
 for y := 1 to 10 do
     Matrix[x,y] := Xaxis[x] + Yaxis[y];

     For x := 1 to 10 do
         for y := 1 to 10 do

outtextxy is like writeln(); http://pascal-programming.info/lesson8.php

             OutTextXY(0,0, Matrix[x,y]' ');

End.
3
  • replaced OutTextYX(0,0, Matrix[x,y]' '); Commented Nov 16, 2012 at 19:02
  • with OutText(Matrix[x,y]); it worked Commented Nov 16, 2012 at 19:02
  • You probably mean Xaxis[2] :='B';, Xaxis[3] :='C';, etc. ;-) Commented Nov 16, 2012 at 19:28

1 Answer 1

1

The OutTextXY routine probably expects two integers and one string as input. The Matrix array holds strings, so use:

OutTextXY(0, 0, Matrix[x, y]);

(Note the missing ' '.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.