a java newbie question

From: Jiong (jiongp_at_yahoo.com)
Date: 05/12/04


Date: 12 May 2004 11:19:59 -0700

Hi, all,

Is there a java equivlant as VB Lset function?
What I need to do is to convert the following VB code to java. In the
VB code, the code converts the data obtained from the database into a
user-defined type (UDT) structure, copies that UDT to another UDT
defined as String, then passes that string to the client component.
The UDT can include any fixed-length datatype. Performing a memory
copy of that UDT to another UDT defined as a string automatically
manages the datatypes in the string.

E.g. I need to copy the entire UDT structure handle.request into a
second UDT structure reqBuffer defined as String.

*****************************************************************
...
Private Function CallServer() As Boolean
    Dim inMsg As reqBuffer
    Dim outMsg As replyBuffer
    info_handle.cErrorText = ""
    info_handle.bInError = False

    LSet inMsg = info_handle.request 'info_handle is a UDT
    If gloWriteRead(inMsg.buffer, outMsg.buffer) Then
        LSet info_handle.reply = outMsg
        CallServer = True
    Else
        info_handle.cErrorText = outMsg.buffer 'outMsg.buffer is a
String
        info_handle.bInError = True
        CallServer = False
    End If
    Set gc = Nothing
End Function
...
***************************************************************

What should I do to achieve this in java? Thanks a bunch.

Below is the UDT in java:
***************************************************************
Class Info {
...
public class Car_glo_604_reply_def {
        Car_header_reply_def car_header_reply = new Car_header_reply_def();
        Glo_604_reply_def glo_604_reply = new Glo_604_reply_def();
}
public class Car_glo_604_req_def {
        Car_header_req_def car_header_req = new Car_header_req_def();
        Glo_604_req_def glo_604_req = new Glo_604_req_def();
}
public class Info_handle_def {
        String successFlag;
        int returnCD;
        boolean bInError;
        Car_glo_604_req_def request = new Car_glo_604_req_def();
        Car_glo_604_reply_def reply = new Car_glo_604_reply_def();
}
Info_handle_def info_handle = new Info_handle_def();
public class ReqBuffer {
        String buffer;
}
public class ReplyBuffer {
        String buffer;
}
...
}
***************************************************************



Relevant Pages

  • Is there a java equivlant as VB Lset function?
    ... What I need to do is to convert the following VB code to java. ... user-defined type (UDT) structure, copies that UDT to another UDT ... defined as a single string, then passes that string to the client ... public class ReplyBuffer { ...
    (comp.lang.java.developer)
  • Is there a java equivlant as VB Lset function?
    ... What I need to do is to convert the following VB code to java. ... user-defined type (UDT) structure, copies that UDT to another UDT ... defined as a single string, then passes that string to the client ... public class ReplyBuffer { ...
    (comp.lang.java.help)
  • Re: Is there a java equivlant as VB Lset function?
    ... > What I need to do is to convert the following VB code to java. ... > user-defined type (UDT) structure, copies that UDT to another UDT ... > defined as a single string, then passes that string to the client ... > public class ReplyBuffer { ...
    (comp.lang.java.help)
  • Re: Thoughts on Collections
    ... string operations. ... It works to declare the UDT in a public-not-creatable ... but can if it's declared in a public class ...
    (microsoft.public.vb.general.discussion)
  • Amazing: Vector can have elements of different types!!!
    ... I just realized/found that in Java, Vector can have elements with different types. ... (say I forgot 1st element is Person, 2nd element is String, etc) ... public class TestDemo { ... private String sName; ...
    (comp.lang.java.programmer)