----- Original Message -----
From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
To: [email protected] <[email protected]>
Sent: Sun Jun 08 00:35:12 2008
Subject: RE: [U2] UOJ and value-mark and field-mark

Change the @FM to @AM  see if what the results are.

-----Original Message-----
From: waivic [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 02, 2008 4:18 PM
To: [email protected]
Subject: [U2] UOJ and value-mark and field-mark

I have a very simple file-TESTS, which only has 4 fields:  @ID field, F1, F2
and F3. F1 is a single value field, F2 is a multi-value field and the value
is one value-mark-separated list, F3 is a single value field. It has the
following sample record in the file:

Field Name          Value
@ID                   t101
F1                     F1V1
F2                     F2V1:@VM:F2V2
F3                     F3V1

I use the following UniObject for Java code segment to retrieve the record
"t101" from the file:

//uSession is a UniSession Oject       
uSession.connect();

//Open a file variable to TESTS file.
 UniFile testFile = uSession.open("TESTS");
         
//Read the record out 
String key = "t101";
UniStirng uString = personFile.read(key);
System.out.println(bthe full record:b+uString);
System.out.println(bthe number of fields in the file:b+uString.dcount());


When I print out the contents of the record, it looks like UOJ converts all
the value marks at the field F2 into the field mark.  When I use dcount()
function to count the number of fields in the output, it returns 5, instead
of 4.  I think the correct result should be 4 since only 4 fields (@ID
field, F1, F2 and F3) in the file. It seems that read() function converts
all the value-marks into the field-marks. So the values at the field-F2:
F2V1:@VM:F2V2 becomes F2:@FM:F2V2. That is why I got 5 instead of 4 when we
use dcount() to count the number of fields in the output. 

We are running Unidata 7.1 in Red hat Linux server.  I already set the
environment variable LANG to bCb. I even tried to set LANG to ben_USb.
Both
times, the UOJ program returned the same result.

Does anyone know how this happens? I want to keep the original value-marks
and field-marks after using read() function. Please advice. 

-- 
View this message in context:
http://www.nabble.com/UOJ-and-value-mark-and-field-mark-tp17612976p17612976.h
tml
Sent from the U2 - Users mailing list archive at Nabble.com.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/



This email and any attached files are confidential and intended solely for the 
intended recipient(s). If you are not the named recipient you should not read, 
distribute, copy or alter this email. Any views or opinions expressed in this 
email are those of the author and do not represent those of the Uni Coop 
Bookshop company. Warning: Although precautions have been taken to make sure no 
viruses are present in this email, the company cannot accept responsibility for 
any loss or damage that arise from the use of this email or attachments.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to