This is a multi-part message in MIME format.

------=_NextPart_000_01AF_01C73B25.375ABA30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,

I am working on a project which will require some data entry for IP =
address (ex: 192.168.1.001). I will like to get some suggestions on how =
to handle this kind of data with some validations. I was thinking in =
having 4 fields to handle each segment and another field to store the =
whole IP, what do you think?

--=20
Edhy Rijo
www.progytech.com
Bronx NY


------=_NextPart_000_01AF_01C73B25.375ABA30
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I am working on a project which will =
require some=20
data entry for IP address (ex: 192.168.1.001).&nbsp; I will like to get =
some=20
suggestions on how to handle this kind of data with some =
validations.&nbsp; I=20
was thinking in having 4 fields to handle each segment and another field =
to=20
store the whole IP, what do you think?</FONT></DIV><FONT face=3DArial =
size=3D2>
<DIV><BR>-- <BR>Edhy Rijo<BR><A=20
href=3D"http://www.progytech.com">www.progytech.com</A><BR>Bronx =
NY</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_01AF_01C73B25.375ABA30--

Re: IP address textbox data entry by Curious

Curious
Thu Jan 18 16:55:22 CST 2007

I would use a single text field. I am not sure the application
environment though.

thisform.text1.InputMask="999.999.999.999"

Procedure thisform.Text1.LostFocus
If !udfCheckAddress(this.value)
this.SetFocus
EndIf
EndProc

Function udfCheckAddress(pcAddr)
local x, lcSeg, retval
pcAddr=alltrim(pcAddr)

retval=.t.
lcSeg=""
for x=1 to len(pcAddr)
if substr(pcAddr,x,1)<>"."
lcSeg=substr(pcAddr,x,1)
else
if val(lcSeg)=0 or val(lcSeg)>=256
retval=.f.
endif
endif
next
return retval

Just my 2 cents. There may be much easier way to do it. If you want
the hassle of four fields, the validation can be much easier.


CJ


On Jan 18, 3:22 pm, "Edhy Rijo" <e...@msn.com.NO_SPAM> wrote:
> Hi all,
>
> I am working on a project which will require some data entry for IP address (ex: 192.168.1.001). I will like to get some suggestions on how to handle this kind of data with some validations. I was thinking in having 4 fields to handle each segment and another field to store the whole IP, what do you think?
>
> --
> Edhy Rijowww.progytech.com
> Bronx NY


Re: IP address textbox data entry by Cy

Cy
Sat Jan 20 22:43:43 CST 2007

Curious Joe wrote:
> I would use a single text field. I am not sure the application
> environment though.
>
> thisform.text1.InputMask="999.999.999.999"
>
> Procedure thisform.Text1.LostFocus
> If !udfCheckAddress(this.value)
> this.SetFocus
> EndIf
> EndProc
>
> Function udfCheckAddress(pcAddr)
> local x, lcSeg, retval
> pcAddr=alltrim(pcAddr)
>
> retval=.t.
> lcSeg=""
> for x=1 to len(pcAddr)
> if substr(pcAddr,x,1)<>"."
> lcSeg=substr(pcAddr,x,1)
> else
> if val(lcSeg)=0 or val(lcSeg)>=256
> retval=.f.
> endif
> endif
> next
> return retval
>
> Just my 2 cents. There may be much easier way to do it. If you want
> the hassle of four fields, the validation can be much easier.
>
>
> CJ
>
>
> On Jan 18, 3:22 pm, "Edhy Rijo" <e...@msn.com.NO_SPAM> wrote:
>> Hi all,
>>
>> I am working on a project which will require some data entry for IP address (ex: 192.168.1.001). I will like to get some suggestions on how to handle this kind of data with some validations. I was thinking in having 4 fields to handle each segment and another field to store the whole IP, what do you think?
>>
>> --
>> Edhy Rijowww.progytech.com
>> Bronx NY
>
I'm not sure that would work too well. Since IP address octets range in
value from 0 to 255 I would think that 4 textboxes capturing numeric
data and checking for values between 0 and 255 would be the most user
friendly along with being the easiest to check for possible validity.

--
Cy Welch
Senior Programmer
MetSYS Inc
http://www.metsysinc.com