title: Create node programmatically with cck location field
body: <p>I try to programmatically create a node of custom contenttype "location" in Drupal 6, with the node containing a location field (http://drupal.org/project/location) called "location" (yes I know, the nomenclature could be better, but I am just experimenting on this at the moment).</p>
  
  <p>Creating the node works just fine, but I cannot find a way to set the contents for the location field - i.e. the node is created with all content but the value for then location field.</p>
  
  <p>I try creating the node like this:</p>
  
  <pre><code>        $newNode = (object) NULL;
          $newNode-&gt;type = 'location';
          $newNode-&gt;title = $locationName;
          $newNode-&gt;uid = $userId;
          $newNode-&gt;created = strtotime("now");
          $newNode-&gt;changed = strtotime("now");
          $newNode-&gt;status = 1;
          $newNode-&gt;comment = 0;
          $newNode-&gt;promote = 0;
          $newNode-&gt;moderate = 0;
          $newNode-&gt;sticky = 0;
  
          $newNode-&gt;field_location[0]['street'] = 'Teststraße';
          $newNode-&gt;field_location[0]['postal_code'] = '12345'; 
          $newNode-&gt;field_location[0]['city'] = 'Musterstadt'; 
  
          node_save($newNode);
  </code></pre>
  
  <p>The node gets created with the correct title, but the location fields remain unset.</p>
  
  <p>How can I programmatically set the location-related fields?</p>
  
  <p>Thanks in advance!</p>