Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Dialogs - maximum lengh of strings

From   Charles Vellutini <>
To   "" <>
Subject   st: Dialogs - maximum lengh of strings
Date   Tue, 5 Apr 2011 04:37:40 -0700

I have a question on the length of strings in dialog boxes. 

In the code below, I use a VARLIST control to let the user enter a variable list in a dialog box; the list is then stored in a global macro. 

When the list get too long, it is unexpectedly cut off at maximum number of characters 528 (including spaces and including the part "global AO_Xcont_g "), without any message or error code. I know that the limit is not from the global macro, so my question is: is there a limit on the length of strings inside a dialog (here Xcont_g.v1_var)? Or (as I hope) what am I doing wrong and why am I hitting a limit? Note that apart from that, the dialog box works seemingly well -- no problem with shorter variable lists. 


    // ----------------- set version number and define size of box ---------
    VERSION 11.1
    POSITION . . 500 200

                    // ------------------------------------------- define a dialog ---------
                DIALOG Xcont_g, tabtitle("Grouped continuous")
                        TEXT    tx_var 10  10 270 ., label("Continuous predictors to be grouped:") 
                        VARLIST v1_var  @ +20   @ ., label("Varia") default (global AO_Xcont_g)
    // -------------------- define the u-action and helper buttons ---------
    OK     ok1, label("OK")
    CANCEL can1, label("Cancel")
    SUBMIT sub1, label("Submit")
    COPY   copy1,
    HELP   hlp1, view("help kappa")
    RESET  res1

    // --------------------------- define how to assemble u-action ---------
    PROGRAM command
                                               if Xcont_g.vl_var{
               put "global AO_Xcont_g " 
                                               varlist Xcont_g.v1_var
                                               else {
                                               put "global AO_Xcont_g """

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index