Hi all,
I am facing issue while replacing stext at ANCI level users copied supports & rename all
but stext not change so I want to replace stext with name of suppo without changing ori in stext.
How we can sort it out.
Thanks....
Hi all,
I am facing issue while replacing stext at ANCI level users copied supports & rename all
but stext not change so I want to replace stext with name of suppo without changing ori in stext.
How we can sort it out.
Thanks....
What are the possible values of the ORI in the stext?
Does it only contains one letter direction? D, U, N, S, E, W?
Or does it also contain more than one letter? Like N45W?
If the number of letters for the orientation is fixed, then a substring text function can be used to keep the orientation data.
!A=!!COLLECTALLFOR(|SSREFE ANCI LUANCI|,||,CE)
DO !ANCI VALUES !A
$!ANCI
VAR !B NAMN OF SUPPO
!S1=!ANCI.STEXT.REPLACE('PS-01-*','$!B')
STEXT '$!S1'
Q STEXT
ENDDO
Done like this but not changing
I think this is not working because the asterisk * character only works in the Matchwild method, not in the Replace method.
I think you can use .substring() if the support name length is fixed to 11 characters.
For example:
VAR !B NAMN OF SUPPO
!currentSupportNameInStext = !B.substring(1,11)
!S1 = !ANCI.STEXT.REPLACE(!currentSupportNameInStext,!B)
STEXT '$!S1'
no change
are there no errors that appear?
can you query the contents of the !A array?
Also, instead of using STEXT '$!S1', try the following:
!ANCI.STEXT = !S1
!A=!!COLLECTALLFOR(|SSREFE ANCI LUANCI|,||,CE)
DO !ANCI
VAR !B NAMN OF SUPPO
!currentSupportNameInStext = !B.substring(1,11)
!S1 = !ANCI.STEXT.REPLACE('$!currentSupportNameinStext','$!B')
!ANCI.STEXT = !S1
Q STEXT
ENDDO
ERROR
2,759) Object does not have a member STEXT
In line 6 of Macro C:\Users\115797\AppData\Local\Temp\tmpC7B5.tmp
!S1 = !ANCI.STEXT.REPLACE('$!currentSupportNameinStext','$!B')
Use the collection and try someting like this "!!ce.stext = !!ce.own.own.namn"
updating like this
Stext PS-01-0017
but want like this
Stext PS-01-00110
ORI = D
ori should not change
What happened to the second line in your code?
Did you remove the VALUES !A?
Now it is only DO !ANCI
instead of DO !ANCI VALUES !A
!!ce.stext = !!ce.own.own.namn + ' ORI ' +(!!ce.stext.after('ORI'))
or
!!ce.stext = !!ce.own.own.namn + ' ORI = ' + !!CE.Pdirection[1].string().before('WRT')