Hi and welcome
When you have the word "for" before #constant xyz 1, is that because it is in your code or did you write that in explanation to us that the error message is
for that particular code?
If it is because it is in your code then it is because "for" is actually the start of a
loop and would be used with"next" similar to this:
for x=1 to 10
print x
next x
wait key
First of all if you don't understand what a variable is please consult the help files and look at the
principles section from the help files
home page followed by the first option available which should read
data types and variables.
Basically the program executes any commands trapped between the "for" and "next" lines. "x" is the variable needed for the
loop which you can use to keep track of the number of times the loop is run before it stops trapping the commands between "for" and "next" and continues to execute commands after the "next" command(which also needs the "x" in order to compile). The command itself uses the variable "x" in conjunction with a step value if provided(detailed in the help files). The variable "x" is being used by the loop very much like you would use a variable. So in the above case the first time the
loop is completed the variable "x" holds the value of 1, then the "print x" line simply outputs the value of "x" to screen. When the program reaches "next x" it jumps back to the "for x=1 to 10" line and continues in the same manner for a second time. This time the "x" value will be 2 when we reach the "print x" line. This is because of the "1 to 10" part which instructs the
loop how many times to cycle through the
loop, so on the third cycle the value of "x" will be 3 and so on until the
loop has been completed 10 times. After the tenth cycle the program no longer jumps back to the "for x=1 to 10" line, instead it continues past the "next x" line and executes the "wait key" command. If you place your cursor on the word "for" then press F1 key the commands help file will open and you can see more information on the command.
The "#constant" command in your line is a sort of variable that is fixed(called a token), if you where to attempt to change that variable using the "=" sign ie "xyz=20" at some point
anywhere in the program the compiler should fail and tell you "unknown type found line ..." as the error message. However you can force it to change by slipping it into the for...next loop(or any of the looping commands) and switching the actual value from "1" to "x". You can also declare the constant token once per source file(any project can use multiple source files)
If however the word "for" was not part of your code and was intended to tell us what line the error was for, then the compiler sometimes gets the wrong line number and/or gives the wrong error message, in which case we will need to see more of the code - the compiler usually does not get the line number wrong unless there are multiple source files used in a project, if this is the case there should be a temp folder in your Dark Basic Pro folder with a dump file that combines all the source files into one file. If you compile this temp dump file the compiler should then give you the correct line number of the error.