515,580 active members
5,889 visitors online
Register for free
Login
Results 1 to 4 of 4
  1. #1
    Registered
    Join Date
    Jun 2017
    Posts
    72

    TNGv2 Possible bug with (array)

    Since there is no documentation/examples that I can find about (array) I had a guess as to how it works, but have come across some strange behaviour. With the following script I would expect the same results, but they differ.

    Code:
    ; _spindlespeed set to 12000
    (clear)
    
    
    (print,This doesn't work)
    (array,4000,SHR[[#<_spindlespeed>*100/60],8],AND[[#<_spindlespeed>*100/60],255])
    (print,#4000)
    #<i> = 0
    O<print> repeat [#4000]
        #<q> = [#[4001+#<i>]]
        (print,#<q,0>)
        #<i> = [#<i>+1]
    O<print> endrepeat
    
    
    
    
    
    
    (print,This does work)
    #<speed_lo> = SHR[[#<_spindlespeed>*100/60],8]
    #<speed_hi> = AND[[#<_spindlespeed>*100/60],255]
    (array,4000,#<speed_lo>,#<speed_hi>)
    (print,#4000)
    #<i> = 0
    O<print> repeat [#4000]
        #<q> = [#[4001+#<i>]]
        (print,#<q,0>)
        #<i> = [#<i>+1]
    O<print> endrepeat
    The output I get is:

    Code:
    This doesn't work
    4.000
    1
    8
    16
    255
    This does work
    2.000
    78
    32

    I don't understand why it is different and the wrong output contains more data than I expected and it seems completely wrong. I hope you can explain.

    Thanks
    Simon

  2. #2
    Moderator PlanetCNC's Avatar
    Join Date
    Mar 2017
    Posts
    505

    Re: TNGv2 Possible bug with (array)

    (array) will not evaluate expressions.

  3. #3
    Registered
    Join Date
    Jun 2017
    Posts
    72

    Re: TNGv2 Possible bug with (array)

    Ok. Maybe it should throw an error if you try?

  4. #4
    Moderator PlanetCNC's Avatar
    Join Date
    Mar 2017
    Posts
    505

    Re: TNGv2 Possible bug with (array)

    Ok, error then.

Similar Threads

  1. TNGv2 for Mac OSX
    By tantemay in forum PlanetCNC
    Replies: 46
    Last Post: 01-03-2020, 04:56 PM
  2. [TNGv2] - Expr.txt
    By PlanetCNC in forum PlanetCNC
    Replies: 2
    Last Post: 11-23-2019, 01:02 PM
  3. [TNGv2] - 2019-11-08
    By PlanetCNC in forum PlanetCNC
    Replies: 0
    Last Post: 11-09-2019, 02:15 AM
  4. [TNGv2] - 2019-10-28
    By PlanetCNC in forum PlanetCNC
    Replies: 0
    Last Post: 10-28-2019, 04:52 PM
  5. [TNGv2 - API]
    By PlanetCNC in forum PlanetCNC
    Replies: 0
    Last Post: 10-27-2019, 11:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •