|
|
|||||||
I'm having a bit of difficulty figuring out the syntax for the @IPADDRESSx macro. I need to map drives based on IP subnets. I'm doing a test with a client machine and this is what I have so far: IF IPAddress0 = 10.34.68.125 (client IP address) USE Y: "\\SERVER\SHARE" ENDIF However, I'm not getting any mappings eventhough the condition is true. I'm wondering if I have to declare variables and and assign IPAddress0 to the variable. Any ideas ??? |
||||||||
|
|
|||||||
Macros must have the @ in front @IPADDRESS0 Brian |
||||||||
|
|
|||||||
Brian, I do have the @ in front. sorry, that's a typo on the board. This is what I have: IF @IPADDRESS0 = 10.34.68.125 USE Y: "\\SERVER\SHARE" ENDIF and it doesn't work. |
||||||||
|
|
|||||||
The @IPAddress0 macro pads with spaces and returns a string. Your if statement is incorrect because one the IP address needs quotes around it and two the your IP returned from the macro is " 10. 34. 68.125". Check out CalcLogicalSubnet() and some other UDFs in the UDF Libraryt that assist with subnet determination. [ 25 June 2002, 00:41: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
eepo, the 0 one has syntax of xxx.xxx.xxx.xxx which means, that if you have address without all three numbers xxx you need a leading space like xxx. xx.xxx.xxx so your code would be: IF @IPADDRESS0 = " 10. 34. 68.125" USE Y: "\\SERVER\SHARE" ENDIF cheers, |
||||||||
|
|
|||||||
eepo, You should be able to do the following: code:BTW, This is in the FAQ Section under - IP Address trimming.; Get the User's IP Address and trim appropriately Thanks, Kent |
||||||||
|
|
|||||||
An lot of verbage for a missing space... OK... and one @ and two " [ 25 June 2002, 00:22: Message edited by: LLigetfa ] |