你好,
抱歉问许多问题我表工作首次托斯卡所以让很多怀疑。
我的问题是:我必须提供缓冲超过一个值使用任何分隔符和我必须由分裂运行循环缓冲区根据分隔符。
为例:我缓冲应该累积,CNAME当我分裂,那么缓冲区(0)应该CNUM并执行验证的行动,然后选择缓冲应该CNAME (1)。
我真的很感激你的帮助和时间。
提前谢谢。
(最初要求和解决支持中心)
最佳答案社区管理员
Step by step explanation of the code:<\/p>
1) Using the TBox Set Buffer module, I have stored the string input ABC,BCD,DEF in the buffer named as InitiatlBuffer<\/p>
2) Using the TC String Operations, I have got the count of the separator , in the buffer Count. So as per logic, number of words in the buffer will be the number of separators + 1.<\/p>
3) I have created a test step folder at which I have set the value of the property Repetition at the folder level as {B[Count]} which means that the steps inside this folder will be repeated as many times as the value of the buffer Count.<\/p>
4) Inside the folder Split buffer I have used 2 steps:<\/p>
\u00a0 \u00a0 1) In the step, Tbox Set Buffer, I am using {XB} to extract one word from the InitialBuffer and then extract the remaining substring.<\/p>
\u00a0 \u00a0 \u00a0 \u00a0 The expression\u00a0InitialBuffer:\u00a0 {XB[Buffer{Repetition}]},{XB[RestString]}<\/strong>\u00a0with the action mode as verify works as follows:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Since the value in InitialBuffer is ABC,CDE,DEF so using XB stores the first word that is ABC in the buffer called Buffer1 (since the\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 value of Repetition is taken dynamically at run time) and stores the rest half of the string BCD,DEF in the buffer RestString.<\/p> \u00a0 \u00a0 \u00a0 \u00a0 Then it stores the value of RestString in InitialBuffer and writes the value of Buffer1 in the new buffer named as Buffer[1] as you\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 want the split buffers in the format Buffer[1], Buffer[2] and so on. This is what gets performed when value of Repetition is 1<\/p> \u00a0 \u00a0 \u00a0 \u00a0 Similarly, the value of Repetition is 2 now, value of InitialString is BCD,DEF. The same steps as explained above get executed and\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 once repetition is executed, you have the values as:<\/p> \u00a0 \u00a0 \u00a0 \u00a0 Buffer[1]= ABC, Buffer[2]=BCD and RestString= DEF<\/p> 5) In the last step, since the total number of words is 3 that is {B[Count]}+1. So storing the value extracted in buffer RestString to the buffer\u00a0Buffer[{MATH[{B[Count]}+1]}] i.e Buffer[3]. So in Buffer[3] the last word gets stored as DEF.\u00a0<\/p> \u00a0<\/p> This logic seems generic to work with any number of words you store in the buffer.<\/p> \u00a0<\/p> Hope this helps !!\u00a0<\/p>","className":"post__content__best_answer"}">