среда, 1 апреля 2009 г.

nStartFrom - 12

Quite a fun usage of variable nStartFrom:

public void setStatementFromAddress(CCallableStatement ccstmt,
CAddressStruct address, int nStartFrom) throws SQLException
{
nStartFrom = nStartFrom - 12;
ccstmt.setString(nStartFrom + 0, address.getStreet());
ccstmt.setLong(nStartFrom + 1, address.getCityID());
ccstmt.setString(nStartFrom + 2, address.getCity());
ccstmt.setLong(nStartFrom + 3, address.getCountyID());
ccstmt.setString(nStartFrom + 4, address.getCounty());
ccstmt.setString(nStartFrom + 5, address.getRegionID());
ccstmt.setString(nStartFrom + 6, address.getRegion());
ccstmt.setLong(nStartFrom + 7, address.getCountryID());
ccstmt.setString(nStartFrom + 8, address.getCountry());
ccstmt.setString(nStartFrom + 9, address.getZIP());
ccstmt.setString(nStartFrom + 10, address.getPhone());
ccstmt.setString(nStartFrom + 11, address.getFax());
ccstmt.setString(nStartFrom + 12, address.getEMail());
}