Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Dialogs - maximum lengh of strings


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

Hi,
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. 

Thanks
Charles


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

                    // ------------------------------------------- define a dialog ---------
    
                DIALOG Xcont_g, tabtitle("Grouped continuous")
                BEGIN
                        TEXT    tx_var 10  10 270 ., label("Continuous predictors to be grouped:") 
                        VARLIST v1_var  @ +20   @ ., label("Varia") default (global AO_Xcont_g)
                                               
                END
    // -------------------- 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
    BEGIN
                                               
                                               if Xcont_g.vl_var{
               put "global AO_Xcont_g " 
                                               varlist Xcont_g.v1_var
                                               }
                                               else {
                                               put "global AO_Xcont_g """
                                               stata
                                               }
      END                        





*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index