Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comparing the size of multiple numerical values
#1
Hi,
I encountered a challenge 
In the code below, the values of each string variable are numbers separated by .    I want to obtain the maximum and minimum values, Is there a simple solution?

Thanks in advance for any suggestions and help
david



Macro Macro2
Code:
Copy      Help
str s1("23.05.17.21") s2("23.05.17.24") s3("23.06.17.24") s4("23.06.18.20")

;out Max 23.06.18.20

;out Min 23.05.17.21
#2
here is one way:
Macro Macro1
Trigger SF9     Help - how to add the trigger to the macro
Code:
Copy      Help
ARRAY(str) s.create(4)
s[1]="23.05.17.21" 
s[0]="23.05.17.24" 
s[2]="23.06.17.24" 
s[3]="23.06.18.20"


s.sort(8)
out s
;out s[0]
;out s[3]
#3
thank you so much!


Forum Jump:


Users browsing this thread: 1 Guest(s)