Creating first module, and How to alter text field on new content creation in Drupal 7? I am trying to set the text in a custom content field when saving a node. I think I need to create a module to do this. (I am new to module creation.)

I started with a blank directory called - let's say myModule. I placed myModule into path sites/all/modules.

I placed into the myModule directory two files that I understand to be required and gave them the following naming conventions which I also believe to be the standard:
myModule.module
myModule.info   

myModule.info holds the following text:   
name = Some Descriptive Name   
description = does stuff.   
package = relatedName   
core = 7.x   


Inside myModule.module I have tried various things that are to much to elaborate , but include these exact functions and parameters.   

Attempt 1:   

function myModule_field_presave($entity_type, $entity, $field, $instance, $langcode, &amp;$items) {   
    if ($node-&gt;type == 'theNameOfACustomContentTypeICreated'){   
        foreach ($items as $delta =&gt; $item) {   
          //I am ver unclear at this point, and this function does not seem to be called when creating new content.   
        }   
    }   


Attempt 2:

myModule_nodeapi($node){   
    //this function does not seem to be called when creating new content.   
}   


I am at a loss. Neither function is even getting called - nor working. 

Edit, the issue is resolved. The correct start was hook_jba_node_presave($node) , but I had syntax errors.
A couple of pointers:


Use only lower case for module names.
$node is not available in hook_field_presave(). $entity should contain necessary info.
hook_nodeapi() is not available in Drupal 7.
It's possible you can make these alterations in your theme's template.php file as well.


You can use the devel module to help with debugging, e.g. dpm($entity, '$entity contains').

Also see Module developer's guide and Drupal 7 API reference for more info.