the code is not too long for me to replace all DOP_COLOR(sth) with HIWORD(sth), 
LOWORD(sth) by hand. But it is some long for concat thus the code will be a 
mess.

But to speak generaly, there is no something like #define A B directive in C, 
which only replace A with B literally, in nim, isn't? Yes, I know #define must 
be used carefully even in C, but I am seeking an elegant workaround in nim.
    
    
    #define DOP_COLOR(col) HIWORD(col), LOWORD(col)
    dim as short opcodes(...)=> { _
      FL_DOP_COLOR   ,DOP_COLOR(FL_RED), _
      FL_DOP_LINE    , _
        FL_DOP_VERTEX,    0,    0, _
        FL_DOP_VERTEX,10000,10000, _
      FL_DOP_END     , _
      FL_DOP_COLOR   ,DOP_COLOR(FL_GREEN), _
      FL_DOP_LINE    , _
        FL_DOP_VERTEX,    0,10000, _
        FL_DOP_VERTEX,10000,    0, _
      FL_DOP_END     , _
      FL_DOP_COLOR   ,DOP_COLOR(FL_BLUE), _
      FL_DOP_LINE    , _
        FL_DOP_VERTEX,    0, 5000, _
        FL_DOP_VERTEX,10000, 5000, _
      FL_DOP_END     , _
      FL_DOP_COLOR   ,DOP_COLOR(Fl_DARK_YELLOW), _
      FL_DOP_POLYGON , _
        FL_DOP_VERTEX, 1000, 1000, _
        FL_DOP_VERTEX, 1000, 9000, _
        FL_DOP_VERTEX, 9000, 9000, _
        FL_DOP_VERTEX, 9000, 1000, _
        FL_DOP_VERTEX, 1000, 1000, _
        _ ' opposite direction = hole
        FL_DOP_VERTEX, 1500, 1500, _
        FL_DOP_VERTEX, 8500, 1500, _
        FL_DOP_VERTEX, 8500, 8500, _
        FL_DOP_VERTEX, 1500, 8500, _
        FL_DOP_VERTEX, 1500, 1500, _
      FL_DOP_END _
    }
    
    
    Run

Reply via email to