There is many problems with the code, not just using "goto" and "lables".
- In structured languages, avoid using goto" and "lables" as that makes code really messy. It fits with assembler, not with structured higher level languages
- Your arguments are pointers, however you use indexes to access value. Use pointer arithmetic, which is much faster.
- Inner loop do not handle situation when there less characters are left in searching string than actually have string which is searched.
- Avoid usage of C like operators (+= and similar) in Pascal program, they are specific for FPC only.
- Avoid using "s:=s+s1" constructions on large strings, as they will moderately slow execution during constant memory reallocation. In your case that can be consider irrelevant (7*18 chars) made for test only, however in real world applications with large amount to concat, that can be extremely slow.
- And return value of function using Result. Returning it through function name is old and long time abandoned Turbo Pascal style.