This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: When Convert a NUMBERLIST to STRINGLIST by ListConvertNumToStr, the items will lost
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 28, 2011
05:05 AM
When Convert a NUMBERLIST to STRINGLIST by ListConvertNumToStr, the items will lost
When Convert a NUMBERLIST to STRINGLIST by ListConvertNumToStr, the items will lost
My program:
// Included header files ----------------------------------------------------
#include "ifx.h"
#define LNUMLIST_FILE "C:\\LNUMLIST_FILE.lst"
#define LNUMLISTADDLIST_FILE "C:\\LNUMLISTADDLIST_FILE.lst"
function OnFirstUIBefore()
STRING szMsgPar;
begin
szMsgPar = "Steven";
MessageBox(szMsgPar, WARNING);
end;
function OnMaintUIBefore()
LIST lNumList;
//LIST lNumListAddList;
LIST lStringList;
NUMBER nListCount, i, nvItem;
NUMBER nListType;
STRING svListCount, sListType, sItem, svString;
begin
//Create NUMERLIST and add Items for the NUMBERLIST
lNumList = ListCreate(NUMBERLIST);
ListAddItem(lNumList,117,AFTER);
//Get current item and conver it to string by function - NumToStr
//CheckPoint1: Expected Result: Messagebox: The Item: 117
ListCurrentItem(lNumList, nvItem);
NumToStr(sItem, nvItem);
MessageBox("The Item:" + sItem, INFORMATION);
//Initialize the STRINGLIST
lStringList = ListCreate(STRINGLIST);
//Convert the NUMBERLIST-lNumList to STRINGLIST-lStringList by function ListConvertNumToStr
//CheckPoint2: Expected Result: MessageBox: ISERR_SUCCESS
if (ListConvertNumToStr(lNumList, lStringList)) >= ISERR_SUCCESS then
MessageBox("ISERR_SUCCESS", INFORMATION);
else
MessageBox("ListConvertNumToStr FAILED", SEVERE);
endif;
//Get the value of First string of STRINGLIST-lStringList
//CheckPoint3: Expected Result: MessageBox:The Current String Value:117
ListGetFirstString(lStringList, svString);
MessageBox("The Current String Value:" + svString, INFORMATION);
//Count the STRINGs num of STRINGLIST-lStringList
//CheckPoint4: Expect Result: MessageBox: svListCount:1
nListCount = ListCount(lStringList);
NumToStr(svListCount, nListCount);
MessageBox("svListCount:" + svListCount, INFORMATION);
end;
Actual Result:
CheckPoint1: MessageBox display - "The Item:117"
CheckPoint2: MessageBox display - "ISERR - SUCCESS"
CheckPoint3: MessageBox display - "The Current String Value:"
CheckPoint4: MessageBox display - "svListCount:0"
CheckPoint3 and CheckPoint4 were not meet my expected result, why?
My program:
// Included header files ----------------------------------------------------
#include "ifx.h"
#define LNUMLIST_FILE "C:\\LNUMLIST_FILE.lst"
#define LNUMLISTADDLIST_FILE "C:\\LNUMLISTADDLIST_FILE.lst"
function OnFirstUIBefore()
STRING szMsgPar;
begin
szMsgPar = "Steven";
MessageBox(szMsgPar, WARNING);
end;
function OnMaintUIBefore()
LIST lNumList;
//LIST lNumListAddList;
LIST lStringList;
NUMBER nListCount, i, nvItem;
NUMBER nListType;
STRING svListCount, sListType, sItem, svString;
begin
//Create NUMERLIST and add Items for the NUMBERLIST
lNumList = ListCreate(NUMBERLIST);
ListAddItem(lNumList,117,AFTER);
//Get current item and conver it to string by function - NumToStr
//CheckPoint1: Expected Result: Messagebox: The Item: 117
ListCurrentItem(lNumList, nvItem);
NumToStr(sItem, nvItem);
MessageBox("The Item:" + sItem, INFORMATION);
//Initialize the STRINGLIST
lStringList = ListCreate(STRINGLIST);
//Convert the NUMBERLIST-lNumList to STRINGLIST-lStringList by function ListConvertNumToStr
//CheckPoint2: Expected Result: MessageBox: ISERR_SUCCESS
if (ListConvertNumToStr(lNumList, lStringList)) >= ISERR_SUCCESS then
MessageBox("ISERR_SUCCESS", INFORMATION);
else
MessageBox("ListConvertNumToStr FAILED", SEVERE);
endif;
//Get the value of First string of STRINGLIST-lStringList
//CheckPoint3: Expected Result: MessageBox:The Current String Value:117
ListGetFirstString(lStringList, svString);
MessageBox("The Current String Value:" + svString, INFORMATION);
//Count the STRINGs num of STRINGLIST-lStringList
//CheckPoint4: Expect Result: MessageBox: svListCount:1
nListCount = ListCount(lStringList);
NumToStr(svListCount, nListCount);
MessageBox("svListCount:" + svListCount, INFORMATION);
end;
Actual Result:
CheckPoint1: MessageBox display - "The Item:117"
CheckPoint2: MessageBox display - "ISERR - SUCCESS"
CheckPoint3: MessageBox display - "The Current String Value:"
CheckPoint4: MessageBox display - "svListCount:0"
CheckPoint3 and CheckPoint4 were not meet my expected result, why?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 29, 2011
12:35 PM
It appears that the documentation for ListConvertNumToStr has the parameters for the function definition reversed. The correct function definition should be:
ListConvertNumToStr(listString, listNumber);
Please try reversing the parameters you are passing to try resolving this issue.
I have submitted a work order regarding this documentation issue.
ListConvertNumToStr(listString, listNumber);
Please try reversing the parameters you are passing to try resolving this issue.
I have submitted a work order regarding this documentation issue.
![](/skins/images/7DF1852B2C95702E61A73F170B191DAC/responsive_peak/images/icon_anonymous_message.png)