labels only allowed on header statements. (602)

Posted by vertumotors on 04-Oct-2017 05:54

Hi 

I am getting the below error message l

"Labels only allowed on header statements. (602)".

I am new to progress so i am trying to understand what what is a header statement. 

The second and most important question though is is there a facility that is can type in the error message i get from progress and get some more information about the error?

Alex

All Replies

Posted by Matt Gilarde on 04-Oct-2017 06:58

You can get the help text for a message in the Procedure Editor. Select Help/Messages and enter the message number. Or use Help/Recent Messages for a message that was recently displayed.

The help text for error 602 is "You put a label in the middle of a block.  Labels can be put only on the beginning of a block." If this doesn't help please post a short, compilable example which shows what you're doing and we can help you fix it.

Posted by Marco Mendoza on 04-Oct-2017 08:21

show us some code.

here you can search https://knowledgebase.progress.com/  or download the offline knlowledgebase.

Posted by Marco Mendoza on 04-Oct-2017 08:36

Good

myLabel:

DO:

END.

Bad

myLabel:

IF TRUE THEN DO:

END.

Posted by Matt Gilarde on 04-Oct-2017 08:55

The IF statement isn't the start of a block so you can't place a label before it. Blocks start with statements like DO, FOR EACH, REPEAT, etc. Block labels are used for error-handling and undoing transactions and you can't undo back to any arbitrary point. Transactions are undone back to the beginning of a block.

The documentation has a lot of information about error-handling, transactions, and blocks. The following may be a good place to start:

https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dverr%2Fabl-block-essentials.html%23

Posted by Lieven De Foor on 09-Oct-2017 08:18

So the solution in this case would be:

IF TRUE THEN

myLabel:

DO:

END.

This thread is closed