Quote:
Originally Posted by chaley
The syntax of Single Function Mode, which you are using, is extremely basic. There is no such thing as a string. Spaces are not ignored. Commas are sometimes ignored. As the documentation says:
You should use either Template Program Mode or General Program Mode. Both use a traditional syntax that separates strings from characters in the program. TPM's syntax is more constrained because it must live inside template snippets.
As for list separators, that is up to you. Any string can be used as a separator in the Template or General Program modes. Calibre uses both comma and ampersand, depending on the data. In some cases it uses a colon, for example in identifiers. You seem to want to split a space-separated phrase into words, which is possible in the more general modes but isn't something calibre does with its standard data types.
|
Thank you - I was afraid of something like this. I'm trying to get the first one or two words from a book or series title - so i'm afraid as far as characters go anything but a space just won't work. If the function won't take a regex or escape character I'll just have to find some other work around.
I'm not much of a programmer, I'm mostly just making semi-educated guesses based on a couple of classes I took 20 years ago (C++ & tried to self teach Obc-C) so no experience with python. When I skimmed through the docs for Program modes I got the impression that it would probably take less time for me to just manually change the text of the books that are causing me problems than it would to learn to solve this programatically.
I thank everyone for their time & especially those who responded!