For Programmers: Free Programming Magazines  


Home > Archive > Java Help > May 2004 > Is there a java equivlant as VB Lset function?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Is there a java equivlant as VB Lset function?
Jiong

2004-05-12, 7:55 pm

Hi, all,

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 a single 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 a single String.
****************************************
****************************
....
Private Function CallServer() As Boolean
Dim inMsg As reqBuffer
Dim outMsg As replyBuffer
Dim gc As New gloConnection
info_handle.cErrorText = ""
info_handle.bInError = False

LSet inMsg = info_handle.request 'the UDT info_handle can be
found in the attached file UDT_java
If gc.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.

****************************************
**********************************
UDT in java

Class info {
....
public class ReqBuffer {
String buffer;
}

public class ReplyBuffer {
String buffer;
}
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();

....
}
Alexey Dmitriev

2004-05-13, 2:32 am

Jiong wrote:

> Hi, all,
>
> 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 a single 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 a single String.
> ****************************************
****************************
> ...
> Private Function CallServer() As Boolean
> Dim inMsg As reqBuffer
> Dim outMsg As replyBuffer
> Dim gc As New gloConnection
> info_handle.cErrorText = ""
> info_handle.bInError = False
>
> LSet inMsg = info_handle.request 'the UDT info_handle can be
> found in the attached file UDT_java
> If gc.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.
>
> ****************************************
**********************************
> UDT in java
>
> Class info {
> ...
> public class ReqBuffer {
> String buffer;
> }
>
> public class ReplyBuffer {
> String buffer;
> }
> 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();
>
> ...
> }

Why are you cross-posting?

--
Alex
Jiong

2004-05-13, 5:32 pm

Sorry. When I was posting first two messages to two different groups,
I got back a message saying something like " the server is busy ".
Well, I guess I did it.

Jiong

Alexey Dmitriev <alexeydmitriev@inbox.ru> wrote in message news:<c7v16j$1o00$2@image.surnet.ru>...
> Jiong wrote:
>
> Why are you cross-posting?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com