jhomer Posted July 7, 2005 Share Posted July 7, 2005 I have created a script to build IP addresses when creating a network. The script utilizes a field called IPserial which is set to auto enter a value starting at 1 and incrementing by one until it reaches 254. these make up the last digits of the IP address. However once all number have been generated i would like to reset the initial value to 1 so the next network i build i can simply run the script. My question then becomes: Is it possible to reset the auto enter serial number via a script step? thanks in advance for any help Link to comment Share on other sites More sharing options...
LaRetta Posted July 7, 2005 Share Posted July 7, 2005 Hi jhomer, Under Fields script-steps, see Set Next Serial Value. Specify Field - yourSerialField and just put a 1 in the calc box. LaRetta Link to comment Share on other sites More sharing options...
comment Posted July 7, 2005 Share Posted July 7, 2005 Or you could use a calculation of: Mod ( IPserial - 1 ; 254 ) + 1 This way you can let IPserial run on, while the result will loop between 1 and 254. Link to comment Share on other sites More sharing options...
jhomer Posted July 8, 2005 Author Share Posted July 8, 2005 thanks Link to comment Share on other sites More sharing options...
chemparrot Posted July 8, 2005 Share Posted July 8, 2005 I am having a problem setting the serial via a script. The script steps where I try to do this are: Go To Record/Request/Page [First] Set Next Serial Value [Table::Serial; Table::globalfield] Replace Field Contents [No dialog; Table::Serial; Serial numbers] But it ignores what I set and just uses whatever is in the entry dialog already, and it doesn't matter whether I use the "Custom Values" or the "Entry Options" setting (I also notice that the 'update entry options' box stays greyed out - I'm not really sure why, and actually I'm not sure what the Entry Options is supposed to do, it really isn't described in the online help at all). It is a problem to try to set this with a globally stored field? And what is "Entry Options" and how do you use it? What am I doing wrong? Link to comment Share on other sites More sharing options...
comment Posted July 8, 2005 Share Posted July 8, 2005 "Entry options" means that you want to use the currently set "Initial value" and "Increment by" in the field definition. Set Next Serial Value[] first, then Replace Field Contents[] with "Entry options" should work. It's hard to say what you're doing wrong without seeing the actual dialog box entry. BTW, it's not necessary to go to the first record. Just make sure all the records you need are found and in the desired order. Link to comment Share on other sites More sharing options...
-Queue- Posted July 8, 2005 Share Posted July 8, 2005 To my knowledge, Set Next Serial Value will only effect the records you create after using the step. To update existing ones, I would use something like Replace Field Contents[ No dialog; Table::Serial; Table::globalfield + Get(RecordNumber) - 1] Set Next Serial Value[Table::Serial; Table::globalfield + Get(FoundCount)] Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7001 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now