Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Numeric Data Mask - Using Regular Expressions


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-03-2008, 08:34 PM
Junior Member
 
Join Date: May 2007
Location: Norwich, NY
Posts: 13
Send a message via Skype™ to david
Default Numeric Data Mask - Using Regular Expressions

Hi Erel,

I continue to work with Basic4PPc and I think it is wonderful. I am still doing work for a Wasp 3200 barcode device running WM 5.0.

My latest application is now nearly 3500 lines in length and growing. A big part of the code is devoted to masking text edit fields for numeric data and making sure that the integer and decimal values on any given field do not exceed the limits imposed in the specifications.

I spoke with a friend who works exclusively in Visual Studion 2005 and he said I could do a numeric mask using Regular Expressions. Although, he thought that might only work on the web side (where he does most of his development).

I now see that the Regex library does include limited support for Regular Expressions. Before I embark on what could be a fruitless effort, can you tell me if the Regex library would allow me to create numeric data masks as described below, and if so, do you have any sample code other than what is in the help file?

Additionally, I should mention that I am still working with Version 5.80. I wanted to finish this project before upgrading.

Thanks for your assistance.

Regards,

David Solomon
Reply With Quote
  #2 (permalink)  
Old 01-04-2008, 07:00 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,335
Default

What Regular Expressions features are you missing in Regex library?

You could use the following code to check if a string is a valid number:
Code:
Sub App_Start
    regex.New1("^[-+]?([0-9]*\.[0-9]+|[0-9]+)$")
    Msgbox(regex.IsMatch("2.454")) 'true
    Msgbox(regex.IsMatch("12:43")) 'false
End Sub
Reply With Quote
  #3 (permalink)  
Old 01-04-2008, 02:13 PM
Junior Member
 
Join Date: May 2007
Location: Norwich, NY
Posts: 13
Send a message via Skype™ to david
Default Numeric Data Mask Using Regex

Hi Erel,

Thanks for the quick reply (as usual).

I will give it a try.

Regards,

David
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
XYCalc -graphs an equation or editable table of figures in regular, bar or pie chart HarleyM Code Samples & Tips 2 11-24-2007 08:21 AM
Numeric Data Input Mask? david Questions & Help Needed 3 11-03-2007 04:04 PM
New Regular Expressions library is released Erel Announcements 1 09-10-2007 06:09 AM
Watch expressions agraham Bug Reports 5 08-15-2007 03:56 PM
Evaluating mathematical expressions Erel Code Samples & Tips 0 06-10-2007 07:56 AM


All times are GMT. The time now is 06:39 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0