a java newbie question
From: Jiong (jiongp_at_yahoo.com)
Date: 05/12/04
- Next message: Chris Sonnack: "Re: Programming is not as much fun/more fun than it used to be."
- Previous message: Mike Smith: "Re: Threads 101 question"
- Next in thread: Joona I Palaste: "Re: a java newbie question"
- Reply: Joona I Palaste: "Re: a java newbie question"
- Reply: Roedy Green: "Re: a java newbie question"
- Reply: kaeli: "Re: a java newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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;
}
...
}
***************************************************************
- Next message: Chris Sonnack: "Re: Programming is not as much fun/more fun than it used to be."
- Previous message: Mike Smith: "Re: Threads 101 question"
- Next in thread: Joona I Palaste: "Re: a java newbie question"
- Reply: Joona I Palaste: "Re: a java newbie question"
- Reply: Roedy Green: "Re: a java newbie question"
- Reply: kaeli: "Re: a java newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|