Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    58

    Unanswered: Visual Basic from Java Translation

    I'm trying to test a piece of code but I'm a VB person not Java. Does anyone know how to translate the following to VB?

    ParameterValue reportParameters[] = new ParameterValue[1];
    String parameterName1 = "Parameter1"; // for report 'Create A Prompt'
    SimpleParmValueItem item1_parm1 = new SimpleParmValueItem();
    item1_parm1.setUse("Tents"); // hard coded value for the parameter.
    item1_parm1.setDisplay("Tents");
    item1_parm1.setInclusive(true);
    ParmValueItem[] pvi1_parm1 = new ParmValueItem[1];
    pvi1_parm1[0] = item1_parm1;
    reportParameters[0] = new ParameterValue();
    reportParameters[0].setName(parameterName1);
    reportParameters[0].setValue(pvi1_parm1);
    ParameterValueArrayProp pv = new ParameterValueArrayProp();
    pv.setValue(reportParameters);
    steps[i].setParameters(pv);

  2. #2
    Join Date
    Jan 2005
    Posts
    362
    Code:
    ParameterValue reportParameters[] = new ParameterValue[1]; 
    String parameterName1 = "Parameter1"; // for report 'Create A Prompt' 
    SimpleParmValueItem item1_parm1 = new SimpleParmValueItem(); 
    item1_parm1.setUse("Tents"); // hard coded value for the parameter. 
    item1_parm1.setDisplay("Tents"); 
    item1_parm1.setInclusive(true); 
    ParmValueItem[] pvi1_parm1 = new ParmValueItem[1]; 
    pvi1_parm1[0] = item1_parm1; 
    reportParameters[0] = new SimpleParmValueItem; 
    reportParameters[0].setName(parameterName1); 
    reportParameters[0].setValue(pvi1_parm1); 
    ParameterValueArrayProp pv = new ParameterValueArrayProp(); 
    pv.setValue(reportParameters); 
    steps[i].setParameters(pv);
    I thing it is not easy to do it...
    For examle SimpleParmValueItem seems to be a object from a class that your code has (in Java,not in VB...).
    It should be easier to understand the thing you want to do and to do it from the beginning.
    Or to give us more informations for this program.
    Dimis

  3. #3
    Join Date
    Apr 2003
    Posts
    40
    Trying to translate code from one language you don't understand to another you do understand is not generally a good idea.
    This is especially the case when the language you don't understand is far richer than the one you do understand (as in this case).

    It is far better to try to comprehend the Java code and not bother trying to figure out how it would translate 1:1 to VB (if it even does at all).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •