Quantcast
Viewing all articles
Browse latest Browse all 2341

Commented Unassigned: EditCellValue string/Integer problem [25251]

Hi,

I think that using EditCellValue to insert an int to a string field transform the value to 0. (EditCellValue(fld,num,3) returns 0 in the field of the shapefile.

I transformed my string field to an integer type and it worked ok.

Olivier
Comments: ** Comment from web user: sleschinski **

Reviewing it before 4.9.3 beta release: I wasn't able to reproduce it with the following code:
```
var fld = tbl.get_Field(0);
Debug.Print("Field type: " + fld.Type.ToString()); // string field
tbl.StartEditingTable();
tbl.EditCellValue(0, 0, 3);
var val = tbl.get_CellValue(0, 0);
Debug.Print(val.ToString()); // returns 3
tbl.StopEditingTable();
Debug.Print(val.ToString()); // returns 3
```
Internally values are stored as VARIANT data type. If integer value is passed to the string field it will be stored as integer ( VT_I4 data member ). On saving to the disk it will be written to the file as string (DBF stores all the data in the text form). All seems to be working as designed.


Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>