Announcement

Collapse
No announcement yet.

MAT statement. Bug ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roberto Valois
    replied
    Thanks.

    RValois



    ------------------

    Leave a comment:


  • Lance Edmonds
    replied
    Ok, according to my notes, MAT CON does not currently work with data types of less than 4 bytes each. Therefore, you'll need to use LONG or DWORD, etc, until the next update to the compiler becomes available.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Lance Edmonds
    replied
    I'm away from the office right now, but I seem to recall that some of the MAT operators require a 'square' matrix... DIM arry(1000) creates an array which is 1001 subscripts which is not 'square'.

    However, when I get back to the office in the morning, I'll double check my notes on MAT and respond back here.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Roberto Valois
    replied
    Lance,

    Thanks, but it does not seem to work with INTEGER and WORD as well.
    I also do not manage to place a SIZE inside the parentheses
    as it is suggested in the manual.

    RValois.

    ------------------


    [This message has been edited by Roberto Valois (edited August 06, 2001).]

    Leave a comment:


  • Lance Edmonds
    replied
    Yes, MAT currently does not work with BYTE arrays. It should work fine with the other numeric data types though.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Roberto Valois
    started a topic MAT statement. Bug ?

    MAT statement. Bug ?

    Hi,

    I'm trying to use the MAT statement but it seems to have a bug.

    Code:
    #COMPILE EXE
    
    FUNCTION PBMAIN () AS LONG
        DIM i AS LONG
        DIM A(1000) AS BYTE
        
        MAT A() = CON
        
        FOR i = 1 TO 1000
            IF A(i) <> 1 THEN
                MSGBOX "BUG: A(" & STR$(i) & ") should be = 1 but A(" & STR$(i) & ") = " & STR$(A(i))
                EXIT FOR
            END IF
        NEXT i
        
        MSGBOX "FIM"
    
    END FUNCTION
    CON(expr) does not work either.

    RValois.

    ------------------
Working...
X