PDA

View Full Version : 18.1A3 Field_Current_Value and Text fields returns corrupt data



Focus
29-Apr-2015, 05:30 AM
If you add the following code to the Customer.vw inside oComments_TP tab page in the 18.1 sacred texts



Object oButton1 is a Button
Set Location to 78 6
Set Label to 'Test'
Set peAnchors to anBottomLeft

Procedure OnClick
String sTest

Get Field_Current_Value of Customer_DD Field Customer.Comments to sTest
End_Procedure
End_Object


Set a break point on the Get Field_Current_Value....
Compile and Run
Open the Customer View
Find record 1
Click on Comments tab
Click the Test button
Step over and you will see the value in sTest which should start with "Innovative" has been corrupted

If you do this same test in 18.0 OrderEntry it works fine

As a work around you can do this



Procedure OnClick
String sTest
UChar[] ucData

Get_Field_Value (RefTable(Customer)) (RefTable(Customer.Comments)) to ucData
Move (UCharArrayToString(ucData)) to sTest
End_Procedure


So there appears to have been a change in behavior between 18.0 and 18.1 when Field_Current_Value is used to retrieve data from a DF_TEXT field

Stephen W. Meeley
29-Apr-2015, 05:58 AM
This sounds like the same issue Peter reported here...

http://support.dataaccess.com/Forums/showthread.php?55908-cTextEdit-bug

...and has been fixed. The next build we publish has that fix.

Focus
29-Apr-2015, 06:15 AM
I didn't make the connection due to his subject being about cTextEdit. Having downloaded his code at the end of his thread I can see he is using Get Field_Current_Value from a DF_TEXT field in his Address table. Hopefully that means you get two fixes for the price of one code change ! :D