Thanks to the folks on Skype chat last night who helped resolve my un-brain moment I was able to resolve my “find the next control” issue and complete this handy little class.
If you have a prompt with the text phone, fax or mobile in it then this class will change the picture on the next entry control to the hard coded ‘@K## #### ####KB’ or in the case of mobile ‘@K#### ### ###KB’.
The class and others that it depends on are in the ClarionClasses repo.
The magic line to get the next control in sequence…
It kinda depends on how you are handling internationalisation in general. Probably the most generic way would be to make the masks properties of the class so you would use it like:
Likely a data problem dependent upon the country code. I looked at your mask examples and immediately thought, that does not work here in the US. More & more, I see long mobile numbers without any mention of country.
Do any of those numbers have a + on the front? At least then you’d know (in theory) that it’s an international number.
Either that or put a field on the front for international country code
Clarion does have Regex that would work here. The Pipe is the OR Operator:
IF STRPOS(thisField{PROP:Text},'phone|mobile|fax',1) ...
or
IF MATCH(thisField{PROP:Text},'phone|mobile|fax',Match:Regex+Match:NoCase)
This code is untested. I often get it wrong, I have to remember the parameters are opposite of INSTRING(Find_This, In_this)
PROP:Precedes is alternative that would probably work better in all cases, like if your Prompt did not have a USE() it would have FEQ > 32000 buyt ENTRY would be in order 1,2,3,4. Prop: was added in C10. I.e. this Prompt FEQ “Precedes” (is before) what FEQ:
There is time between code releases for the Help to catch up. Seems fair to say it has almost been abandoned. I had talked to Z about moving the Help online and he liked the idea but it has not happened. Delphi help is online.
For now you have to read the Blog, look at release ReadMe.Txt, review listed PTTS, and compare LibSrc + Template folders… It’s exciting to find new things but should be easier. The problem is likely there is no documentation author that is looking for something to write everyday…
Where have you gone, Robert “Bob” Foreman?
Developers turn their lonely eyes to you
Woo, woo, woo
What’s that you say, Mr. Robert Z ?
Verbose Bob has left and gone away
Hey, hey, hey
Hey, hey, hey
Koo-koo-ka-choo, Richard Taylor
Geeze we miss you more than you will know
Whoa, whoa, whoa
See Also, See Also, See Also
You have a problem with & Alt keys so ‘Fa&x’ does not contain ‘fax’ e.g.
PROMPT('Fa&x Number:'),AT(10,44)
Which is easily solved by changing PROP:Text to PROP:Value which does NOT have the &. Also works for other controls with &Alt keys like TAB, OPTION, RADIO, CHECK. Screen cap from my WndPreview class on GitHub.
I think I would change your code to first look for ENTRY with Prop:Text of ‘s’ or ‘k’. If it is ‘s’ then check the length (sub(pict,2,3)) is big enough, like >= 10. Only if the ENTRY can handle the @k### do you then look to see if Feq{PROP:Follows} (the control before that FEQ follows) is a PROMPT with Prop:Value containing Fax, Phone, Mobile.