Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Refine Code Help


1 reply to this topic

shotsy247

shotsy247
  • Members
  • 4 posts

Posted 22 December 2004 - 18:03

Ok I'm useing the following code to build a list that is displayed in a dialog box. This code checks to see which components the user has selected and displays them in the list.

CODE
szComponent = "New Employee\\Network Client";
   ComponentGetData ( MEDIA , szComponent , COMPONENT_FIELD_SELECTED , nvResult , svResult );
   
   if(nvResult = TRUE) then
    ComponentGetData ( MEDIA , szComponent , COMPONENT_FIELD_DISPLAYNAME , nvResult , svResult );
    ListAddString( listStartCopy, svResult, AFTER );
   endif;
   
   szComponent = "New Employee\\Network Server";
   ComponentGetData ( MEDIA , szComponent , COMPONENT_FIELD_SELECTED , nvResult , svResult );
   
   if(nvResult = TRUE) then
    ComponentGetData ( MEDIA , szComponent , COMPONENT_FIELD_DISPLAYNAME , nvResult , svResult );
    ListAddString( listStartCopy, svResult, AFTER );
   endif;



My question is, how can I make this code less redundant? Is there a way to get a master component list and loop through it?

Please forgive my ignorance, I am very new to IS. I'm actually suprised I have gotten this far blink.gif

Thanks for the assist.

_t

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 December 2004 - 10:17

Would ComponentListItems help?