garlapati
14th May 2014, 17:41
suppose
in the script flow as below
string org.comp(3)
----------------
org.comp = "USA"
...........
...........
............
................
org.comp = ""
--------------------
in the above simple statment will org.comp variable will be emptied or not?
to my strange it didn't. any suggestions?
bhushanchanda
14th May 2014, 18:59
Hi,
It should work unless you are not doing anything else
string org.comp(3)
org.comp = "USA"
org.comp = ""
This part will empty it without any issues.
garlapati
14th May 2014, 19:13
actually in previous iteration the value is getting assigned
in the next iteration when i am trying org.comp="" with out space its still keeping the old value. if i give it as org.comp = " " with space then value is going off.
do we need to give space " " to empty the previous value in strings?
did so many programs but this happening strangely.
thanks
mark_h
14th May 2014, 19:35
What is in the actual code? Like bhushan mentioned it should work if it is declared as a string. The actual code and declaration might help someone see something.
Joy Conner
15th May 2014, 00:00
Have you tried doing a trace on the variable in debug mode. It will stop when the variable is changed. It helps sometimes.
garlapati
15th May 2014, 21:27
Joy : i tried debugging and placed trace at that place.
in previous iteration the value is org.comp = "USA"
in next interation i am initializing the variable with org.comp = ""
then going for logic.
but when the control reachs org.comp = "" and executes the line still the value in org.comp remaings value "USA" instead of ""
but when i tried initializing variable with org.comp = " " then its getting filled with space.
strange situation cam across.
mark:
here is the logic originally
org.comp = ""
on case logi.ncmp
case 100:
org.comp = "US1"
break
case 102:
org.comp = "US6"
break
case 103:
org.comp = "103"
break
case 106:
org.comp = "US4"
break
case 109:
org.comp = "US5"
break
case 131:
org.comp = "US3"
break
case 133:
org.comp = "US2"
break
default:break
endcase
garlapati
15th May 2014, 21:29
for logi.ncmp i am getting value of baan companies as shown above.
mark_h
15th May 2014, 23:44
How is org.comp declared - is it fixed?
vamsi_gujjula
16th May 2014, 11:59
exactly thats what i was thinking Mark ;)
Fixed
But even then it should work !!!
garlapati
16th May 2014, 16:37
as i mentioned in my first post its declared as
string org.comp(3)
no fixed or based declarations.
simplly string org.comp(3)
mark_h
16th May 2014, 19:40
Is this the only string variable that does this? I do not ever recall seeing this in 4c3. Something you can try is retcode = set.mem(org.comp, "") just to see what happens. It almost seems like the program is treating it like a fixed variable, but even then setting it to empty should work.