Author Topic: Recursive code replacement definition  (Read 2654 times)

Offline stefan

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Recursive code replacement definition
« on: November 26, 2022, 02:37:48 PM »
I wonder if it is possible to have code replacements in the replacement part?
As an example lets say that I have keyword definitions for zebras and gnus and instead of writing =zebra=, =gnu= in the keyword dialog I want to write one code =zg= and don't want to repeat the replacement text in the code replacement file.

This is what I want to be able to write:

zebra        mammal | zebra | Plains zebra | Common zebra | Equus quagga
gnu        mammal | antelope | Wildebeest | Gnu | Blue Wildebeest | Western White-bearded Wildebeest | Connochaetes taurinus mearnsi

zg        =zebra=, =gnu=

instead the only way I have found to do this is to write the last definition as:

zg        mammal | zebra | Plains zebra | Common zebra | Equus quagga, mammal | antelope | Wildebeest | Gnu | Blue Wildebeest | Western White-bearded Wildebeest | Connochaetes taurinus mearnsi

Online ahoward

  • Camera Bits Staff
  • Hero Member
  • *****
  • Posts: 972
    • View Profile
Re: Recursive code replacement definition
« Reply #1 on: November 29, 2022, 05:02:25 PM »
If I am understanding you correctly, what you have suggested does actually work for me (essentially, there are 3 lines in my code replacement file, one for zebra, one for gnu, and one with zg, which expands to =zebra=, =gnu=, which then expands to the respective replacement for those terms). Perhaps the Code Replacement file did not get formatted correctly? Can you send us a copy of the file? If you'd prefer not to post it publicly you can send it to support@camerabits.com

Offline stefan

  • Newcomer
  • *
  • Posts: 5
    • View Profile
Re: Recursive code replacement definition
« Reply #2 on: December 10, 2022, 02:17:04 PM »
I have tested this in my original file and it works perfectly just as I wanted. I thought that I was very careful with the syntax before I asked but obviously I missed something. Thanks for answering!