Good afternoon! I'd like to know if I'm doing this right:
I have a string that gets the full name of my baseline (ie 'new baseline 10.08'), which I later apply one function to get only the numeral part. Follow the code dxl:
string currentBaseLineName = name(curMod)
Array splitedCurentBaseLineNumber = split(currentBaseLineName," ") //split my baseline name
string currentBaseLineNumber = getArrayString(splitedCurentBaseLineNumber, 3) //get only the numbers
real NomedoBaseline = realOf(currentBaseLineNumber) // transform the string to real
delete splitedCurentBaseLineNumber //delete the array
if( NomedoBaseline >= NomedoAtributo ) { //compare
...etc...
}
I'm doing it right? The problem I'm facing is because of this?
And finally, is there an easier way in which I can compare real numbers?
Thanks! braolive - Mon Jun 18 17:10:05 EDT 2018 |
Re: comparing numbers From what I read, you are not working with baselines (File -> Baseline -> new), but with modules that have been copied and renamed after a specific naming convention, am I right?
Your input parameter "name (curMod)" will only give you the name of the module, i.e. when you have a module with the name "myReq" and you create a baseline, your module will still be called "myReq" and this module will have Baselines that you can iterate over. If you want to work with real baselines, you should first look into the section "Baselines" in the DXL manual or look into some forum posts. (note that baselines have a creation date that you probably want to use when sorting)
If you want your script to work with the copied modules, you should give us a sample of module names that you have in your list and one can see whether there is a flaw in your algorithm. |