cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Buaron
Level 3

IP Address Condition

Hello,
i am trying to use a field for ip address value, using the ### as the property to change.
i want to make sure that only Valid IP addresses can be filled in the value field.
i understand that i need to use a condition for 0 < 255 ...

i`m working with instalshield 2008 pro.

can anyone please post how do i set this condition for the IP value ???

thanks
Labels (1)
0 Kudos
(10) Replies
Buaron
Level 3

i managed to set the field to accept only <255 but now i can only press the Next button if i fill 3 characters in the field (###)
so that if i need the IP : 191.162.10.5 i need to input 191.162.010.005

what to do ???
how do i fix it ???

thanks
0 Kudos
Gvarma
Level 7

Buaron wrote:
i managed to set the field to accept only <255 but now i can only press the Next button if i fill 3 characters in the field (###)
so that if i need the IP : 191.162.10.5 i need to input 191.162.010.005

what to do ???
how do i fix it ???

thanks


Are you using MaskEdit control in MSI or SendMessage windows API to create IP Address control on the fly?
0 Kudos
Buaron
Level 3

hey Gvarma,
i am using MaskedEdit in MSI, using ###.###.###.### as the Mask.
it`s the same if i`m using seperate MaskedEdit boxes usin ### mask for each one.
0 Kudos
Gvarma
Level 7

Buaron wrote:
hey Gvarma,
i am using MaskedEdit in MSI, using ###.###.###.### as the Mask.
it`s the same if i`m using seperate MaskedEdit boxes usin ### mask for each one.


Ok then instead of using #### , do this



hth
0 Kudos
Buaron
Level 3

if i am using ??? instead of ### i get the same problem as before- i need three characters to be filled in order for the condition to work.
in addition, if i use ???, i can also input Letters and not only Numbers, like the ### gives me...

so not only it didnt solve the problem, it added a new problem...

could it be that maybe i am missing something else? :confused:
do i need to set anything besides the Mask?
maybe the condition itself is wrong?
all i have there is: [Propety]<255 , this works fine in limiting the numbers but thats it...
0 Kudos
Gvarma
Level 7

Buaron wrote:
if i am using ??? instead of ### i get the same problem as before- i need three characters to be filled in order for the condition to work.
in addition, if i use ???, i can also input Letters and not only Numbers, like the ### gives me...

so not only it didnt solve the problem, it added a new problem...

could it be that maybe i am missing something else? :confused:
do i need to set anything besides the Mask?
maybe the condition itself is wrong?
all i have there is: [Propety]<255 , this works fine in limiting the numbers but thats it...


OK now i understand

you need to add this to mask <###.###.###.###> include greater then and less then sign.

This will accept 1 two or three degits but will not validate your entered IP address ( > 255) which I assume you are already doing it.

This will work
0 Kudos
Buaron
Level 3

using the <###.###.###.###> as mask causes two problems for me:
1. it creates gaps between the fields of the IP (example- 192.168._10.__5 instead of 192.168.10.5)
2. i cant control the IP range, which means that any number can be the field (it can even be 999.999.999.999) since the mask is for the entire IP address and not for each box by itself.

what i need to create [IPADDRESS] = [IP1].[IP2].[IP3].[IP4]
and i need to control each one of the [IP%] to be under 255.
but i keep getting into the same loop that i need three characters to filled or the the Next button doesnt work...:(
0 Kudos
Gvarma
Level 7

Buaron wrote:
using the <###.###.###.###> as mask causes two problems for me:
1. it creates gaps between the fields of the IP (example- 192.168._10.__5 instead of 192.168.10.5)
2. i cant control the IP range, which means that any number can be the field (it can even be 999.999.999.999) since the mask is for the entire IP address and not for each box by itself.

what i need to create [IPADDRESS] = [IP1].[IP2].[IP3].[IP4]
and i need to control each one of the [IP%] to be under 255.
but i keep getting into the same loop that i need three characters to filled or the the Next button doesnt work...:(


You will have to write some custom code to LTRIM and RTRIM your vars/property where you are accepting ip adress. Using these two functions you could easily remove left and right spaces.

For ranges as well, you could write a custom function in which you set the PROPERTY to 0, if it exceeds 255 or less then 0 and dont let the dialog box process further unless conditions are met.

you could easily achieve this in MSI, as dialog properties lets you have control over the dialog box.

Alternatively you could import a SD..rul script for existing dialog box, define you IP MASK control there, and customize it for accepting IPADDRESS validation.


HTH
0 Kudos
Buaron
Level 3

thanks for the help...
i was hoping i didnt need to use code for this operation, however, i see no other solution...
i thought that the MaskedEdit will provide the answer by it self.
thanks again !!!
0 Kudos
Gvarma
Level 7

Buaron wrote:
thanks for the help...
i was hoping i didnt need to use code for this operation, however, i see no other solution...
i thought that the MaskedEdit will provide the answer by it self.
thanks again !!!


MaskEdit (as the name says) is just a maskEdit control NOT a ipaddress controller, though you could customize it to make a ipaddress control.

I dont wanna confuse you but with little code change you could use "IP Address Dialog Box" written by Robert Dickau on installsite.org

URL is
http://www.installsite.org/pages/en/isp_ui.htm

but there also you will have to write some code to customize, create, instialize your control

HTH
0 Kudos