ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Positioning Cursor with INFDS in Free.

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

  • Positioning Cursor with INFDS in Free.

    I have an issue with numeric types in free and I hope some one can help!

    I have set @ROW and @ COL in my DDS as 3S 0H which are used for CSRLOC.

    To position the cursor in native RPG I would do the following:

    DScreenInfds DS
    D CursorLocation 370 371B 0

    C CursorLocation Div 256 @Row
    C Mvr @Col

    In Free I am doing the following:

    /Free
    @Row = %Div(CursorLocation:256)
    @Col = %Rem(CursorLocation:256)
    /End-Free

    However, I'm getting a Receiver Value error as the result is to small. My problem is down to the fact I'm performing a calculation with the quotient being binary.

    Obviously native RPG is more forgiving!

    What is the best way to convert the binary format to the correct format without error.

    Ta,
    Stu

  • #2
    Re: Positioning Cursor with INFDS in Free.

    What about:
    PHP Code:
    D DspfSDS         DS                      
    D  DDSFKey              369    369        
                                              
    D  DDSRow               370    370I 0     
    D  DDSCol               371    371I 0    

     
    /Free
       
    @Row DDSRow;
       @
    Col DDSCol;
     /
    End-Free 
    Birgitta

    Comment


    • #3
      Re: Positioning Cursor with INFDS in Free.

      Solutions are always the simple ones!

      Thanks,
      Stu

      Comment

      Working...
      X