Using a regular expression

Chris,

Try wrapping inside a Form Event Wizard subroutine to trap BeforeAdapterMethod of whatever the apps primary adapter is.

Typically you want to trap the "Update" method, but since I don't know what app and adpater you're using, that may not be true. Within the wizard generated code, unremark (') this line:

MessageBox.Show(args.MethodName)

Save your customization. Close and reopen it. Start doing whatever it is you normally do in the app that leads up to the need for you to (eventually) do your formatting chores.

The next messagebox that pops up will display the method name the adapter is just about to execute.

That is you target method. If it is "Update" just insert your format enforcement code after the Case "Update" statement. If it isn't "Update", change "Update" (in the Case statement) to match whatever it IS... And THEN insert your foramt enforcement code.

Oh yeah: Go back and remark out (')

'MessageBox.Show(args.MethodName)


Save your customization. Close the app.


Then make sure it is menu enabled & active. CLose Vantage and repoen/login.

Try it out. If it works, tell your boss you're taking the rest of the day off ;o)

If it doesn't {;( read the error & test code message(s) & fix it.

(Aren't you done YET?!?!) :)


Rob




--- On Wed, 12/3/08, Chris <chris.ryhal@...> wrote:

From: Chris <chris.ryhal@...>
Subject: [Vantage] Re: Using a regular expression
To: vantage@yahoogroups.com
Date: Wednesday, December 3, 2008, 4:52 PM






Perhaps I'm not placing in the correct sub routine. Would like it to
happen when user is trying to save the Customer information.

Compile states that:

Error: BC30451 - line 49 (231) - Name 'txtPostalCode' is not declared.

txtPostalCode is the name of the control on the form.

--- In vantage@yahoogroups .com, "Brian W. Spolarich "
<bspolarich@ ...> wrote:
>
> Is the code not compiling? Are you including
> System.Text. RegularExpressio ns at the beginning of the source file?
>
>
>
> --
>
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced
Photonix /
> Picometrix
>
> bspolarich@. .. ~ 734-864-5618 ~
> www.advancedphotoni x.com
>
>
>
> From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On
Behalf
> Of Chris
> Sent: Wednesday, December 03, 2008 3:39 PM
> To: vantage@yahoogroups .com
> Subject: [Vantage] Using a regular expression
>
>
>
>
> Any idea how I may be able to implement a regular expression (see
> below) to validate that the user inputs ZipCode+4 I.E. 54891-5815?
has
> to be this way.
>
> In .NET, it would be done like below code but I seem to have a lot
of
> problems with implementing this simple regular expression.
>
> This example would assume that "txtControl. Text" was the Postal
Code
> box on the form.
>
> Dim r As New Regex("^\d{5} \-\d{4}$" )
> Dim ok As Boolean
> ok = r.IsMatch(txtContro l.Text)
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Any idea how I may be able to implement a regular expression (see
below) to validate that the user inputs ZipCode+4 I.E. 54891-5815? has
to be this way.

In .NET, it would be done like below code but I seem to have a lot of
problems with implementing this simple regular expression.

This example would assume that "txtControl.Text" was the Postal Code
box on the form.

Dim r As New Regex("^\d{5}\-\d{4}$")
Dim ok As Boolean
ok = r.IsMatch(txtControl.Text)
Is the code not compiling? Are you including
System.Text.RegularExpressions at the beginning of the source file?



--

Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix /
Picometrix

bspolarich@... ~ 734-864-5618 ~
www.advancedphotonix.com



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Chris
Sent: Wednesday, December 03, 2008 3:39 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Using a regular expression




Any idea how I may be able to implement a regular expression (see
below) to validate that the user inputs ZipCode+4 I.E. 54891-5815? has
to be this way.

In .NET, it would be done like below code but I seem to have a lot of
problems with implementing this simple regular expression.

This example would assume that "txtControl.Text" was the Postal Code
box on the form.

Dim r As New Regex("^\d{5}\-\d{4}$")
Dim ok As Boolean
ok = r.IsMatch(txtControl.Text)





[Non-text portions of this message have been removed]
Perhaps I'm not placing in the correct sub routine. Would like it to
happen when user is trying to save the Customer information.

Compile states that:

Error: BC30451 - line 49 (231) - Name 'txtPostalCode' is not declared.

txtPostalCode is the name of the control on the form.



--- In vantage@yahoogroups.com, "Brian W. Spolarich "
<bspolarich@...> wrote:
>
> Is the code not compiling? Are you including
> System.Text.RegularExpressions at the beginning of the source file?
>
>
>
> --
>
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced
Photonix /
> Picometrix
>
> bspolarich@... ~ 734-864-5618 ~
> www.advancedphotonix.com
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf
> Of Chris
> Sent: Wednesday, December 03, 2008 3:39 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Using a regular expression
>
>
>
>
> Any idea how I may be able to implement a regular expression (see
> below) to validate that the user inputs ZipCode+4 I.E. 54891-5815?
has
> to be this way.
>
> In .NET, it would be done like below code but I seem to have a lot
of
> problems with implementing this simple regular expression.
>
> This example would assume that "txtControl.Text" was the Postal
Code
> box on the form.
>
> Dim r As New Regex("^\d{5}\-\d{4}$")
> Dim ok As Boolean
> ok = r.IsMatch(txtControl.Text)
>
>
>
>
>
> [Non-text portions of this message have been removed]
>