Forum > Windows
Array Syntax issues
(1/1)
J011Y_R063R:
It doesn't seem to matter what I do, I cannot get the syntax of this array to be accepted. I am pretty sure its missing the 'type' but this just kinda got dumped on me, and I am new to pascal. Any help would be greatly appreciated.
procedure REA7PinInkJetText;
var
NumChars,NumGaps: integer;
TextHgt,CharDist,GapDist,TextNoteAng,TextAng,TextAngDif,AccDist,AccDistBkwd: double;
StartX,StartY,EndX,EndY: double;
TextHeight,CharacterDistance,GapDistance,TextAngleDiff,AccelerationDistance,AccelerationDistanceBackwards: array[1..5] of double;
begin
if (PostObj.DoingTime) then exit;
From here it goes on to define the variables described above.
The error is based off sytax and my plugin that points out these errors, keeps referring me to the section between
'array' and '[1..5]'
This would usually mean there is an error in this specific location, but... to me this part looks fine, so I am wondering if the issue is not elsewhere in the section.
As this is an issue at work, I cannot share MUCH MORE than this, but will provide additional information as able.
MarkMLl:
--- Quote from: J011Y_R063R on February 03, 2021, 06:30:16 pm ---It doesn't seem to matter what I do, I cannot get the syntax of this array to be accepted. I am pretty sure its missing the 'type' but this just kinda got dumped on me, and I am new to pascal. Any help would be greatly appreciated.
...
As this is an issue at work, I cannot share MUCH MORE than this, but will provide additional information as able.
--- End quote ---
Before anything else, we appreciate that this is a work issue but could you /please/ tag code properly using [ code] and [ /code] markers (without the space after the bracket). This isn't just cosmetic, it prevents the forum system from trying to- as an example- interpret [ i] as the start of italicised text.
Looking at your code, try something like
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure REA7PinInkJetText; type TdistanceArray= array[1..5] of double; var NumChars,NumGaps: integer; TextHgt,CharDist,GapDist,TextNoteAng,TextAng,TextAngDif,AccDist,AccDistBkwd: double; StartX,StartY,EndX,EndY: double; TextHeight,CharacterDistance,GapDistance,TextAngleDiff,AccelerationDistance,AccelerationDistanceBackwards: TdistanceArraybegin if (PostObj.DoingTime) then exit; [/quote]
Having said that it would help if you'd quoted the /exact/ error message.
MarkMLl
speter:
For what its worth, I pasted your code into a procedure and got no errors (just lots of warnings about variables not being used). :)
Maybe you should rename your variables (in the unlikely event a var name is clashing with some global variable); for example prefix the variable names with "ij_" or similar.
cheers
S.
PascalDragon:
--- Quote from: J011Y_R063R on February 03, 2021, 06:30:16 pm ---As this is an issue at work, I cannot share MUCH MORE than this, but will provide additional information as able.
--- End quote ---
You can at least quote the exact error message as MarkMLI said.
speter:
One thought I had; there is a TextHeight method in TCanvas...
Navigation
[0] Message Index