I have a drop down list, actully four of them. When I refresh them it appears to disregard the first row which is blank. If I start it with someting that has text in it instead of a blank line "CRLF" it works correctly. Or least appears to. So I tried adding a space and it failed. Below is a portion of the script:
oSub>FolderandFileNameIndex
SRT>FolderandFileNameIndex
Let>blankline=
Let>option1=%blankline%%CRLF%Zone 1%CRLF%Zone 2
Let>DIALOG1.FOLDER1.ITEMS.TEXT=%option1%
Let>DIALOG1.FOLDER2.ITEMS.TEXT=%option1%
Let>DIALOG1.FILENAME1.ITEMS.TEXT=%option1%
Let>DIALOG1.FILENAME2.ITEMS.TEXT=%option1%
If>%SN1%=
Let>DIALOG1.Folder1.ITEMINDEX=0
Endif
If>%SN1%=Zone 1
Let>DIALOG1.Folder1.ITEMINDEX=1
Endif
If>%SN15=Zone 2
Let>DIALOG1.Folder1.ITEMINDEX=2
Endif
If>%SN2%=
Let>DIALOG1.Folder2.ITEMINDEX=0
Endif
If>%SN2%=Zone 1
Let>DIALOG1.Folder2.ITEMINDEX=1
Endif
If>%SN2%=Zone 2
Let>DIALOG1.Folder2.ITEMINDEX=2
Endif
Here you will see I tried to use blankline (normally I just use %CRLF%) but that fails However, it works when it is first loaded and if I change blankline to blankline=test it will work as well. The item index comes back correctly it is as if there are only two items in it. (Zone 1 and Zone 2) The carriage return and line feed are missing.
Any ideas?
Blank line in drop down list on resetting
Moderators: JRL, Dorian (MJT support)
Hi kpassaur,
If you could post the whole script that would be helpful but I took a crack at it anyways to see if this is what you are going for.
That will load the dialog with a blank line.
Is that what you are trying to do?
-Josh
If you could post the whole script that would be helpful but I took a crack at it anyways to see if this is what you are going for.
Code: Select all
let>blankline=
let>defaultoption=%blankline%%CRLF%Zone 1%CRLF%Zone 2
Dialog>dialog1
Caption=
Width=445
Height=250
Top=508
Left=1711
ComboBox=folder1,19,21,145,%defaultoption%
ComboBox=folder2,22,61,145,%defaultoption%
ComboBox=filename1,25,99,145,%defaultoption%
ComboBox=filename2,31,138,145,%defaultoption%
EndDialog>dialog1
show>dialog1
Is that what you are trying to do?
-Josh
load with blank line
Yes, what happens is it loads correctly the first time. The script calls another compiled script, reads some information etc. (it is a very large script) and updates a dialog. (the dialog that contains this). When it reloads the index value is correct; however, the blank line is not there, so it will be moved to the next value. So "Zone 1" becomes index value 0 instead of one.
The part that is confusing me is that if I replace the %CRLF% with a value such as "test" it works correctly.
The part that is confusing me is that if I replace the %CRLF% with a value such as "test" it works correctly.
ok here is a modified version of my earlier post, it basically updates the first combobox when you click the updatedialog button. It also resets the index value and retains the empty line. I know this is a gross oversimplification of your script but maybe this will help.
-Josh
Code: Select all
let>blankline=
let>defaultoption=%blankline%%CRLF%Zone 1%CRLF%Zone 2
let>newoption=%blankline%%CRLF%Zone 31%CRLF%Zone 342
Dialog>dialog1
Caption=
Width=445
Height=250
Top=141
Left=59
ComboBox=folder1,19,21,145,%defaultoption%
ComboBox=folder2,22,61,145,%defaultoption%
ComboBox=filename1,25,99,145,%defaultoption%
ComboBox=filename2,31,138,145,%defaultoption%
Button=update,270,45,75,25,5
EndDialog>dialog1
show>dialog1
label>actionloop
GetDialogAction>dialog1,r
if>r=5
gosub>updatedialog
endif
goto>actionloop
srt>updatedialog
let>dialog1.folder1.items.text=%newoption%
let>dialog1.folder1.itemindex=-1
resetdialogaction>dialog1
END>updatedialog