If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > Visual Basic from Java Translation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-02-07, 22:08
asahi asahi is offline
Registered User
 
Join Date: Oct 2005
Posts: 58
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);
Reply With Quote
  #2 (permalink)  
Old 08-06-07, 15:04
dimis2500 dimis2500 is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 08-07-07, 02:12
jwenting jwenting is offline
Registered User
 
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).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On