I need to create a dialog box whose width varies. So wrote a routine that creates the dcl file on the fly. For some reason, even thought the WIDTH= numbers ARE being changed, the dialog box doesn't display in the appropriate size. I even tried commenting out the line that creates the dcl file and MANUALLY changing the width in the file that had already been created. Regardless of what I change the number to, the width of the dialog box remains UNCHANGED. I thought maybe it was somehow loading a dcl file from a different location. So when I was manually changing this width I'd also change the title bar label. THAT change DID show up. After I get it working properly, I'll worry about putting it in more appropriate directory than the ROOT. The more important task is to get it WORKING. TIA ;This is how the DCL file looks as created by the routine. ask : dialog { initial_focus = "OK"; width = "1400"; <-I tried changing this MANUALLY to 4400, 5400 & 6400 : column { : text { key = "Message"; width = "1120"; <-I tried changing this MANUALLY to 4120, 5420 & 6420 } } ok_cancel; } ;end of dcl file (defun ask(msg / return) (setq rdi msg) ;when I was changing the width manually, I'd comment the next line out (writeDCL "c:/ask.dcl" (* 50 (strlen msg))) (if (not(setq dcl_id(load_dialog "c:/ask.dcl")))(exit)) (if (not(new_dialog "ask" dcl_id))(exit)) (set_tile "Message" msg) (action_tile "accept" "(done_dialog 1)") (action_tile "cancel" "(done_dialog 0)") (if (= 0(start_dialog)) nil T) ) (defun writeDCL(nm width) (setq fp(open nm "w")) (write-line "ask : dialog {" fp) (write-line " initial_focus = \"OK\"\;" fp) (write-line (strcat " width = \"" (itoa(atoi(rtos width))) "\"\;") fp) (write-line " : column {" fp) (write-line " : text {" fp) (write-line " key = \"Message\"\;" fp) (write-line (strcat " width = \"" (itoa(atoi(rtos (* 0.8 width)))) "\"\;") fp) (write-line " }" fp) (write-line " }" fp) (write-line " ok_cancel\;" fp) (write-line "}" fp) (close fp) )
Um. I also think the width values are way excessive. Think in terms of integers representing the number of characters you want to display on one line. Remember that all DCL tile values are filled as strings, but certain tile properties are numeric.
John, I realize that they are excessive. I was just changing the numbers trying to get the the width to actually close. I'll make the changes in the morning. Thx.
R.K. Thanks. I'll fix that in the morning. -- RDI (remove the exclamation from the email address) Remove the "quotes" from the width values