AmiBlitz / AmiBlitz3

Complete package of AmiBlitz3 including all sources.
https://www.amiblitz.de/
123 stars 9 forks source link

Label and apostrophe #19

Closed Nju79 closed 2 years ago

Nju79 commented 3 years ago

I've problems to concatenating labels. When I use the third key from right the IDE change this character automatically to "4". When I use Shift + this key (same as the apostrophe on the first key in left in the row) then the compiler tell me he can't find the concatenated label.

What's the right apostrophe on the keyboard to use this feature? Or is this a bug?

honitos commented 2 years ago

What do you exactly want to do? A label is something to jump to, e.g.

Goto exit

.exit:
End

You can place the dot in front of the label do add it to the labels list window.

Nju79 commented 2 years ago

After one year I can't remember it anymore. In my records I only find the hint that an optional apostrophe in front of a label (e.g. 'myLabel) expands the corresponding label. What exactly is meant by this, I can't find in the AmiBlitz documentation anymore and, as I said, I have forgotten. :(

honitos commented 2 years ago

Ah, yes, now I know...

The apostrophe concats the label with the last label to realize "local" labels".

That means you can have same label twice in the code.

For example:

label1: `exit:

label2: `exit:

... as the compiler automatically combines the labels so they are different.

On the original amiga keyboard the apostrophe may be reached by this key: grafik

On WinUAE it is normally mapped to the key called "grave" (above the TAB-key).

Information about that behaviour may be found in the AmiBlitz3-Guide at "Syntax" and there under "2.1.1 Labels".