Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. Integer iArrayCount
  2. Integer iLoop
  3. Number nVal
  4.  
  5. Number nLargest
  6. Number nSmallest
  7. Number nTotal
  8. Number nAverage
  9. Number nNeutralNo
  10. Number nPositiveNo
  11. Number nNegativeNo
  12.  
  13. String sResult
  14. Move "" to sResult
  15.  
  16. Get Item_Count of oMyNumbers to iArrayCount
  17.  
  18. Move 0 to nTotal
  19. Move 0 to nNeutralNo
  20. Move 0 to nPositiveNo
  21. Move 0 to nNegativeNo
  22.  
  23. For iLoop from 0 to (iArrayCount - 1)
  24. Get Value of oMyNumbers item iLoop to nVal
  25.  
  26. // If (nVal ne 999999) Begin
  27. If (iLoop eq 0) Begin
  28. Move nVal to nLargest
  29. Move nVal to nSmallest
  30. End
  31. Else Begin
  32. If (nVal gt nLargest) Move nVal to nlargest
  33. If (nVal lt nSmallest) Move nVal to nSmallest
  34. End
  35.  
  36. If (nVal gt 0) Move (nPositiveNo +1) to nPositiveNo
  37. Else If (nVal lt 0) Move (nNegativeNo +1) to nNegativeNo
  38. Else Move (nNeutralNo +1) to nNeutralNo
  39.  
  40. Move (nTotal +nVal) to nTotal
  41. // End
  42.  
  43. Loop
  44.  
  45. Move (nTotal/iArrayCount) to nAverage
  46.  
  47.  
  48. Append sResult "Number of data entries: " iArrayCount sLineFeed "Total: " nTotal sLineFeed "Average: " nAverage sLineFeed sLineFeed
  49. Append sResult "Number of positive values: " nPositiveNo sLineFeed "Number of negative values: " nNegativeNo sLineFeed "Number of neutral values (0's): " nNeutralNo
  50. Append sResult sLineFeed sLineFeed "Largest value: " nLargest sLineFeed "Smallest value: " nSmallest
  51.  
  52.  
  53. Send Info_Box sResult "Array data results"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement