Total sum of value in buffer

Home Forums Problems and solutions in GDL Others Total sum of value in buffer

Tagged: , ,

This topic contains 4 replies, has 3 voices, and was last updated by  Pavel Čapek 1 year, 2 months ago.

  • Author
  • #2712

    Pavel Čapek

    Is there a posibbility to get total sum of value from buffer. I imagine somethink like totalSum=sum(get(nsp)).

    Thanks for replay.

    Pavel Čapek
    senior developer
    BIM Project

  • #2719

    Joachim Sühlo

    Isn’t it simple NSP itself, which gives you the sum?

    GDL Object Developer
    MAC OSx 10.11

    • #2720

      Pavel Čapek

      Hello Joachim,
      thanks for reply. But this is not what I mean. Maybe my example bellow will bring some clarification to what I mean.

      put 1, 2, 3, 4

      “nsp” gives me a number of values count => 4 not a sum of values => 10

      Pavel Čapek
      senior developer
      BIM Project

  • #2724

    Barry Kelly

    Maybe this?

    for n = 1 to (NSP)
    	totalSum = totalSum + GET (1)
    next n
    print totalSum


    Versions 6.5 to 20
    Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
    Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit

You must be logged in to reply to this topic.