on 07-24-2008 11:25 AM
Hi all,
I am trying to use the sapscript counter variable in my sapscript but encounter the following warning.
My code looks like the following:
/: DEFINE &SAPSCRIPT-COUNTER_0& = 0
The new counter value is &SAPSCRIPT-COUNTER_0(+)&
The warning i get when i do the syntax check is:
Ambiguous symbol &SAPSCRIPT-COUNTER_0&
What is wrong with my syntax?
Appreciate any help i can get.
Hi,
You can directly use the counter variable
&sapscript-counter_x&
if you want to reset the value back to 0 then you can use the syntax.
/: define &sapscript-counter_0& = 0.
regards
padma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If i am not wrong you are trying to reinitializing that standard variable. if that is the case one thing, in script we cannot assign values to variable other than at initializing time but here you don't have chance to initialize that variable because that is standard one. More over modifications to standard variable will give some warnings.
So try to use other than standard one as per your requirement.
Hope this will help you.
Regards,
Aswini.
Hi Aswini,
Based on your reply, i m using the following code:
/: DEFINE &COUNTER_0& = 0
/: &COUNTER_0& = &COUNTER_0& + 1
AS The value of the counter is &COUNTER_0&
When i do a checking of the text, i get the error "Command expected" on the second command.
What is wrong with my code? What is the right syntax?
Hi,
&SAPSCRIPT-COUNTER_x& is the pre defined symbol
you need not redefine that symbol again
you can use this symbol where ever you want
Regards
Jagadeesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.