Data Access Worldwide Knowledge Base

Article ID 2182
Article Title EXAMPLE: Columnar formatting of Windows in an image section
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2182
KBase Category DF 3.2
Date Created 10/28/2005
Last Edit Date 11/15/2005


Article Text
QUESTION:
In my program there is an image with windows organised in a table shape. I want to #FORMAT the windows of a particular column. How do I do that?

Sample of my image is:
/imgtest2
___ ____ __/__/____ ___. __E__
___ ____ __/__/____ ___. __E__
___ ____ __/__/____ ___. __E__
___ ____ __/__/____ ___. __E__
___ ____ __/__/____ ___. __E__
/*

SOLUTION:
If you add the following command to your macro libary you can format a column of windows. This macro is an enhancement of FORMAT_TABLE written by Clive Richmond and published in FlexLines Mar/Apr 1988 Page 13.

#COMMAND FORMAT_GRID R#LG "WITH" RVCFWL#B #L%U #L%U
    //------------------------------------------------------------------------
    // Macro to format a number of windows
    //
    // Usage: FORMAT_GRID <image>.<startwindow> WITH <options> <increaseby> <repeatcount>
    //    eg: FORMAT_GRID screen1.10 WITH {CAPSLOCK} 2 5
    //    or: FORMAT_GRID wCustomerName WITH {RANGE=1,10} 2 5
    //------------------------------------------------------------------------
    #IFTYPE !1 "N"
        #SET E$ !1
        #FORMAT |WN!e !3
        #IF (!5 > 1)
            #SET E$ (!e + !4)
            #SET G$ (!5 - 1)
            FORMAT_GRID |WN!e WITH !3 !4 !g
        #ENDIF
    #ENDIF
    #IFTYPE !1 "S"
        #SET E$ !1
        #FORMAT |WS!e !3
        #IF (!5 > 1)
            #SET E$ (!e + !4)
            #SET G$ (!5 - 1)
            FORMAT_GRID |WS!e WITH !3 !4 !g
        #ENDIF
    #ENDIF
    #IFTYPE !1 "D"
        #SET E$ !1
        #FORMAT |WD!e !3
        #IF (!5 > 1)
            #SET E$ (!e + !4)
            #SET G$ (!5 - 1)
            FORMAT_GRID |WD!e WITH !3 !4 !g
        #ENDIF
    #ENDIF
    #IFTYPE !1 "R"
        #SET E$ !1
        #FORMAT |WR!e !3
        #IF (!5 > 1)
            #SET E$ (!e + !4)
            #SET G$ (!5 - 1)
            FORMAT_GRID |WR!e WITH !3 !4 !g
        #ENDIF
    #ENDIF
#ENDCOMMAND

The original FORMAT_TABLE macro is:

// format_table, written by Clive Richmond, published in Flexlines mar/apr 1988 page 13
// formatting multiple windows
// !1 = imagename
// !2 = the first windownumber
// !3 = "with"
// !4 = {the window options}
// !5 = number of windows in one row
// !6 = number of windows in one column
#COMMAND FORMAT_TABLE R#LG VFG#L "WITH" RVCFWL#B #L%U #L%U
  #SET E$ !2
  #FORMAT !1.!e !4
  #IF (!6 > 1)
    #SET G$ (!6 - 1)
    #SET E$ (!e + !5)
    FORMAT_TABLE !1 !e WITH !4 !5 !g
  #ENDIF
#ENDCOMMAND


Contributed By:
Vincent Oorsprong
Company: Data Access Worldwide
email: vincent.oorsprong@dataaccess.eu
Web Site: http://www.dataaccess.eu


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.