increment counter
Moderators: chulett, rschirm, roy
increment counter
Hi,
I would like a counter to be loaded in a field.
For ex:-
First run
Record1 counter=1
Record2 counter=2 so on
Second run
Record1 counter=1
Record2 counter=2 so on
Every time job is run counter should be intialized to 1.
I used KeyMgtGetNextValue function but its not intializing counter to 1 at the start of second run.
Thanx.
I would like a counter to be loaded in a field.
For ex:-
First run
Record1 counter=1
Record2 counter=2 so on
Second run
Record1 counter=1
Record2 counter=2 so on
Every time job is run counter should be intialized to 1.
I used KeyMgtGetNextValue function but its not intializing counter to 1 at the start of second run.
Thanx.
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Course not, that's not what it is for. <smack>
Use that when you need it to pick up from where it left off last time. Use one of the ROWNUM system variables:
@INROWNUM
@OUTROWNUM
Read the online help available for them so you understand the difference.
![Wink :wink:](./images/smilies/icon_wink.gif)
Use that when you need it to pick up from where it left off last time. Use one of the ROWNUM system variables:
@INROWNUM
@OUTROWNUM
Read the online help available for them so you understand the difference.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 30
- Joined: Wed Apr 12, 2006 11:23 am
Re: increment counter
Try Modifying the routine. Open the routine and click on the 'CODE' tab. Then comment the last line in the code that reads
"Writeu NextVal On SeqFile, Arg1 Else Ans = -1". Put an asterisk * in front of it .
This routine may not modify as it is built-in, try copying the code and paste it in a new routine. Name it and OWN IT !!!![Twisted Evil :twisted:](./images/smilies/icon_twisted.gif)
"Writeu NextVal On SeqFile, Arg1 Else Ans = -1". Put an asterisk * in front of it .
This routine may not modify as it is built-in, try copying the code and paste it in a new routine. Name it and OWN IT !!!
![Twisted Evil :twisted:](./images/smilies/icon_twisted.gif)
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
chulett wrote:They all can edited unless someone specfically goes and makes them RO.
![Surprised :o](./images/smilies/icon_surprised.gif)
I'm not able to edit it.
![Wink :wink:](./images/smilies/icon_wink.gif)
![Confused :?](./images/smilies/icon_confused.gif)
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Participant
- Posts: 30
- Joined: Wed Apr 12, 2006 11:23 am
Alright let me take all the pain to explain you in peace.
1. Right click on routines tab in ur repository
2. choose "New Routine"
3. Name it "XYZ" and paste the code that you copied from the earlier one.
4. Now edit it as you wish, and dont forget to change the filename in which the data will be written.
5. This way no one will kill you if someone is already using it.
6. Or you can use the @INROWNUM/@OUTROWNUM as suggested.
7. And i mentioned already that you cannot edit the built-in ones, so NAME IT AND OWN IT.
This is the deal !!! You ask for one and we give you many. Cheers :D . OHHH I LOVE THIS PLACE![Idea :idea:](./images/smilies/icon_idea.gif)
1. Right click on routines tab in ur repository
2. choose "New Routine"
3. Name it "XYZ" and paste the code that you copied from the earlier one.
4. Now edit it as you wish, and dont forget to change the filename in which the data will be written.
5. This way no one will kill you if someone is already using it.
6. Or you can use the @INROWNUM/@OUTROWNUM as suggested.
7. And i mentioned already that you cannot edit the built-in ones, so NAME IT AND OWN IT.
This is the deal !!! You ask for one and we give you many. Cheers :D . OHHH I LOVE THIS PLACE
![Idea :idea:](./images/smilies/icon_idea.gif)
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Hi,devilsmentor wrote:Alright let me take all the pain to explain you in peace.
1. Right click on routines tab in ur repository
2. choose "New Routine"
3. Name it "XYZ" and paste the code that you copied from the earlier one.
4. Now edit it as you wish, and dont forget to change the filename in which the data will be written.
5. This way no one will kill you if someone is already using it.
6. Or you can use the @INROWNUM/@OUTROWNUM as suggested.
7. And i mentioned already that you cannot edit the built-in ones, so NAME IT AND OWN IT.
This is the deal !!! You ask for one and we give you many. Cheers :D . OHHH I LOVE THIS PLACE
I'm not the OP.
![Wink :wink:](./images/smilies/icon_wink.gif)
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
True, they are. Sorry. I was confused there for a moment and thinking about other routines. Keep the advise more as general advise not to make changes to existing routines unless you own them and are aware of the impact the change will have on every job that uses them.
Otherwise, you're just asking for trouble.
Otherwise, you're just asking for trouble.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers