With GetItemText(nIndex,n), n should be 1-based, not 0-based.
Also, fixed ISXEQ-specific code to set n properly.
MQ2DataTypes.cpp
Code: Select all
@@ -3636,7 +3636,7 @@
return true;
case List:
{
[color=red]- int n = 0;
+ int n = 1;[/color]
if (((CXWnd*)pWnd)->GetType()==UI_Combobox)
VarPtr.Ptr=pWnd->SidlText;
else if (((CXWnd*)pWnd)->GetType()!=UI_Listbox)
@@ -3645,16 +3645,16 @@
#ifndef ISXEQ
if (PCHAR pComma=strchr(Index,',')) {
n = atoi(pComma+1) - 1;
[color=red]- if (n < 0) n=0;
+ if (n < 1) n=1;[/color]
DebugSpew("List: index is %d\n", n);
*pComma = '\0';
}
#else
if (argc==2)
{
[color=red]- n=atoi(argv[0]);
- if (n<0)
- n=0;
+ n=atoi(argv[1]);
+ if (n<1)
+ n=1;[/color]
}
#endif
if (ISNUMBER())
