Thank you Bruce.
That has really helped. I now understand that the instructions for the
dialog box are a *string* which is why they need to be *joined* by ++.
I have successfully made a combo box with drop down menus of days.
But now I have a new problem.
If, in the example you gave, I make the For.. Loop loop to i = 14, each
prompt in the combo box gives a choice of 14 dates.
But by the time I get to the third date, I only get a few of the the dates,
and in fact the last date is only part of the date.
If I change the For.. loop to include i= 7 I can get to 5 check boxes but
again the fifth box has only some of the dates.
I wonder if there is some sort of memory limit for the box going on here?
Alistair
My script, which is about prescribing in instalments is here (watch the
wrap):
local d = date
local StartDay
for (local i=0; i<7; i=i+1)
local s = s ++ formatdate("dddd, dd MMMM yyyy", date.addDays(d, i)) ++
"|"
endfor
local return = inputdialog("~,=^StartDay = Date of First
Installment??"++s++"^SecondDay = Date of Second
Installment??"++s++"^ThirdDay = Date of Third Installment??"++s++"^FourthDay
= Date of Fourth Installment??"++s++"^FifthDay = Date of Fifth
Installment??"++s,"What day do you want the prescription to start?")
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of brucexs
Sent: 25 February 2006 03:03
To: [email protected]
Subject: [power-pro] Re: Variables as items to select in a combo box
>
> I have two remaining problems.
> When I tried the first example I found that TodayFormatted and the
other
> date variables were not being evaluated in the dialog box, so they
appeared,
> not as a date as in your second example but as TodayFormatted ie
as their
> variable names.
I was careless on this one. It should be
Inputdialog ("~,=^StartDay = Choose a day??" ++ TodayFormatted
++ "|" ... ++ TodayplusSixFormatted, "title"))
The idea is to build up a string by joining with ++ the strings
("~,=^StartDay = Choose a day??"
with the contents of the variable
TodayFormatted
followed by a
"|"
followed by the next variable, and so on until the last variable.
The string for inputdialog is confusing because you actual want a
variable name within the quotes before the = (in this case
StartDay), where it serves the special purpose of naming the place
for the results. But the rest of the string has to use the contents
of the variables to build up the combo box values.
As another example, consider showing a messagebox
MessageBox("ok", TodayFormatted ++ "|" ++ TodayplusSixFormatted)
which will show the first and last dates in a message. If this
makes sense to you, it may help with Inputdialog.
>
> In the second example I wanted to have more than one drop down
list in my
> combo box.
Perhaps the following example will help.
local out1, out2
local box1vals = "1,|2|3,3|4|5"
local box2vals = "a|b|c|d"
inputdialog("~,=^out1=title1??"
++box1vals++ "^out2=title2??"++box2vals, "title")
The inputdialog is all one line.
Here is explanation:
box1vals has the values for first drop down. (You would need to
change for your purposes, of course). Note commas which I have
included since your dates might have them.
box2vals has values for second.
In the inputdialog line:
~ means no file or folder buttons
,=^ means use ^ to separate different elements on the dialog
out1=title1?? means create a drop down combo box title1 and put its
selected value in out1
++box1vals incorporates the drop down values
^ is the separator stating a new dialog element follows (changed
from , by ,=^ at start)
similarly for out2 title2 box2vals
There is no doubt that this is quite confusing and just illustrates
that PowerPro dialogs, esp combox boxes, are not at all easy to use.
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/