Re: Range A-Z


Florian Groothuis
 

Doesn’t RepStr() do exactly the same?

 

RepStr(‘ABCDEFGABCDEFG’,’EF’,’XX’) returns ‘ABCDXXGABCDXXG’

 

 

Met vriendelijke groet - With kind regards,

Florian Groothuis
Analist/programmeur
+31 (0)6 21927914


meilink.eu

Meilink Beheer Borculo B.V. • Kamerlingh Onnesstraat 1
7271 AZ  Borculo • Nederland • +31 (0)545 253525
KvK 08009803 • Our general terms and conditions apply • Disclaimer


Van: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] Namens sherman levine
Verzonden: vrijdag 21 juli 2017 1:35
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Range A-Z

 

Perhaps download a copy of Get.DLL from http://mggen.free.fr/

It has a very nice function get.str_translate which will translate any character(s) to any other character(s)

This function (UDF) translate a string in another string, using  as conversion table the 2 specified strings.

·    [A] String to translate.

·    [A] From string.

·    [A] To string

·    Returns : [A] For instance, str_translate('azerty', 'az', 'ZA') will return 'ZAerty', and str_translate('azerty', 'aze', '1') will return '1rty'.

If you for example translate
 (entry string,'ABCDEFGHJIKLMNOPQRSTUVWXYZ ',XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
(where the 2nd string has a space at the end and the third is 27 Xs)
If the result is a string of Xs, then all the characters are valid, otherwise not.

Sherm

On 07/20/2017 02:18 PM, ra goulart wrote:

Jakes thank you for e-mail it seems a great alternative but I've never used CRR before.

How can I  add the two .Net assemblies to CRR repository? I need to set any magic.ini configuration to use .net?

 

Thanks,

Ricardo

 

 

On Thu, Jul 20, 2017 at 12:42 AM, Jakes du Preez <dupreez.jakes@...> wrote:

I agree with Maor, regular expressions would be the way to go in this case. It will make for much less coding, and is not as complex as one would think. There are multitudes of patterns available that would cover most use cases. I saw that you mentioned being a newbie, so I added a bit more detail on using this.

 

Aside from the Find Text functionality (<Ctrl>+<Shitf>+F), I could not find anything in Magic that exposes this. You can always use the .Net Regular Expressions. I haven't used it before but, after the clever people in Google, I found these links:

 

 

 

I also made and uploaded an Online program that tests a string for three different scenarios: Uppercase Alpha, Mixedcase Alpha and AlphaNumeric.

 

You will need to add two .Net assemblies to your CRR repository. The ones I used in the program is shown in brackets.

System (C:\windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll)

System.Text.RegularExpressions (C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Text.RegularExpressions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Text.RegularExpressions.dll)

 

Hope this will be of value

 

Regards

 

Jakes

 

On Wed, Jul 19, 2017 at 8:59 PM, ra goulart <gf103rt@...> wrote:

Thanks a lot by all your help. 

 

I'm a newbie using unipaas 1,9o for a few months that's I had this kind of doubts .

 

The ideia is to avoid the  user to enter accents or special characters in order to have just plain names.

 And yes Florian I need to allow spaces(I just added IT at the beginning of the (range: space,A-Z). 

 

I tried Steve's suggestion  A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z as a Range but it didn't work for full words.

 

I'll try Govert's idea using a event handler  to check after the field is changed.  

Maybe it's the best solution as Florian guessed (Isn't a check afterward maybe the better way to go?)

 

Thanks

 

 

 

 

On Wed, Jul 19, 2017 at 3:28 AM, Florian Groothuis <f.groothuis@...> wrote:

But thsi methods definitely creates some unwanted boundries. TS uses "JOHN SMITH" as an example so you have to provide the spacebar as well. What if you want to enter "KÖLN", or "FENÊTRE"? Want to add all these too? Better start from the beginning: what is the reason you want to allow only A-Z? Isn't a check afterward maybe the better way to go?

Met vriendelijke groet - With kind regards,

Florian Groothuis
Analist/programmeur
+31 (0)6 21927914

 


meilink.eu
Meilink Beheer Borculo B.V. • Kamerlingh Onnesstraat 1
7271 AZ  Borculo • Nederland • +31 (0)545 253525
KvK 08009803 • 
Our general terms and conditions apply • Disclaimer

 

-----Oorspronkelijk bericht-----
Van: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] Namens Steven Blank
Verzonden: woensdag 19 juli 2017 1:44
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Range A-Z

Ricardo,

I found it difficult to believe that A-Z doesn't work as expected so I tried, and sure enough, it doesn't. I'm almost sure it USED to work that way...

What DOES work appear to work correctly is to list all the characters you want to allow, separated by commas, as follows:

A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

Copy and paste the above into the Range property and give it a go.

Steve Blank



At 12:42 PM 7/18/2017, you wrote:
>Hi there!
>
>Sorry my questions is quite simple but I don't know how to solve it.
>I have to allow in a Virtual character only space or letters from A-Z.
>It's a name variable.
>
>I´ve tried to set in the Virtual properties --> Data View --> Details
>--> Range: A-Z But it still allows others character like !/=+4.
>Thanks,
>Ricardo
>



 

 

 

 

Join main@magicu-l.groups.io to automatically receive all group messages.