Hi all!
1. Can anybody try next ops in URS strategy
Create 3 variable - str1, int1, flo1
Assign to str1 value '9.70' (str1='9.70')
Assign to int1 value str1 (int1=str1)
Assign to flo1 value str1 (flo1=str1)
Print result (Print[str1], Print[int1], Print[flo1])
Post result here. I have next:
str1: 9.70
int1: 9
flo1:[color=red]9.6999999999999993[/color] - what a hell?!
2. In IRD we have a cool function StrAsciiTok. "The purpose of this function is to parse out a string value from a string consisting of multiple substrings delimited by characters functioning as separators; the separators are the characters occurring in Char Set."Every time the function StrAsciiTok is called, it stores in memory the index in
String of the last character of the obtained substring. For instance, calling StrAsciiTok[toy,;,pan,,;,0] three consecutive times will return toy the first time, pan the second time, and (the empty string) the third time."
Simple to parsing any complex string value, is't? OK, but disagreeable moment - if u use it function 1-st time in the sub-strategy, the 2-nd call it sub-strategy don't clear this memory flag. As result -calling same sub-strategy for one interaction more than once,return us unexpected value =(
Example:
Strategy Main call sub-strategy con_str2_wav. In con_str2_wav we call result=StrAsciiTok[complete_path,'+',0]
there 'complete_path' is a string '100+20'. For instance, calling StrAsciiTok three consecutive times will return 100 the first time, 20 the second time, and (the empty string) the third time. After it we return in the Main strategy. Do samething, create next string, and call sub-strategy con_str2_wav second time. In con_str2_wav we again call result=StrAsciiTok[complete_path,'+',0] there 'complete_path' now is a string '200+10'. But after first calling it's return (the empty string)
Can anybody help me understand how i can use power of StrAsciiTok, but clear 'memory flag' after sub-strategy end?