Topic: Condition true according to the place occupied by a letter

Good morning, everyone, and thank you for your interest.
What would need to be written in a condition to determine that it is true if the place occupied by a letter is right?
Just to understand this, I give an example:
If in a word entered in an edibox, the third letter is C and the fourth is D then if the word in the written editbox is abcd then the condition is true.
Thank you all and regards.

2 (edited by sparrow 2023-05-10 20:14:56)

Re: Condition true according to the place occupied by a letter

Hi,


Everything you need to write you have already written.
Just change a little.
Find the substring 'CD' in the string and if it is at the desired position, then the condition is true. It remains to find a function that does this. I think that it is necessary to search in string functions. )))

http://www.delphibasics.co.uk/index.html is a good reference. Fortunately and sometimes unfortunately in MVD there are far fewer of them.

Re: Condition true according to the place occupied by a letter

Hi Fabio, Hi Sparrow,
Have a look at the attached examples (there are 3 options and they all use the basic 'copy' function);  which one is most suitable depends on what you are wanting to do.  But it should help to get you started.
The link Sparrow has suggested is one I've used quite a few times when I've got stuck so I'm sure you'll find it useful.
Regards,
Derek.

Post's attachments

Attachment icon string search.zip 439.01 kb, 92 downloads since 2023-05-11 

Re: Condition true according to the place occupied by a letter

Hello sparrow and derek,
thanks for the link of which I am already reading several articles. Derek's project clarified how to do what I was asking. Thank you very much.

Re: Condition true according to the place occupied by a letter

Hi Fabio,
I may be wrong but it is my understanding that MVD does not support all the functions available in Pascal/Delphi - only a sub-set are available. 
So just be aware that there might be a (very occasional) time when you read about a function that you want to put in your script only to find that you cannot use it in MVD (after spending hours wondering if it's you who is doing something wrong big_smile)! 
I know - I've been there!!
Derek.

6 (edited by reteinformatica 2023-05-11 16:24:24)

Re: Condition true according to the place occupied by a letter

Thank you derek for the elucidation. Don't worry that as you have seen if there are any problems I don't hesitate to ask, however, not before searching the forum and doing a "million" tests.. Let's just hope that, if I understand correctly by now MVD will no longer be developed, at least the forum will remain "alive".