Enterpriseone 8.93 Development Standards Business Function Programming Peoplebook

Enterpriseone 8.93 Development Standards Business Function Programming Peoplebook

EnterpriseOne 8.93 Development Standards Business Function Programming PeopleBook May 2004 EnterpriseOne 8.93 Development Standards Business Function Programming PeopleBook SKU TT893DSB0504 Copyright© 2004 PeopleSoft, Inc. All rights reserved. All material contained in this documentation is proprietary and confidential to PeopleSoft, Inc. ("PeopleSoft"), protected by copyright laws and subject to the nondisclosure provisions of the applicable PeopleSoft agreement. No part of this documentation may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, including, but not limited to, electronic, graphic, mechanical, photocopying, recording, or otherwise without the prior written permission of PeopleSoft. This documentation is subject to change without notice, and PeopleSoft does not warrant that the material contained in this documentation is free of errors. Any errors found in this document should be reported to PeopleSoft in writing. The copyrighted software that accompanies this document is licensed for use only in strict accordance with the applicable license agreement which should be read carefully as it governs the terms of use of the software and this document, including the disclosure thereof. PeopleSoft, PeopleTools, PS/nVision, PeopleCode, PeopleBooks, PeopleTalk, and Vantive are registered trademarks, and Pure Internet Architecture, Intelligent Context Manager, and The Real-Time Enterprise are trademarks of PeopleSoft, Inc. All other company and product names may be trademarks of their respective owners. The information contained herein is subject to change without notice. Open Source Disclosure This product includes software developed by the Apache Software Foundation (http://www.apache.org/). Copyright (c) 1999-2000 The Apache Software Foundation. All rights reserved. THIS SOFTWARE IS PROVIDED “AS IS’’ AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PeopleSoft takes no responsibility for its use or distribution of any open source or shareware software or documentation and disclaims any and all liability or damages resulting from use of said software or documentation. Table of Contents About These EnterpriseOne PeopleBooks Preface 1 EnterpriseOne Application Prerequisites ........................................................ 1 Obtaining Documentation Updates ................................................................. 1 Typographical Conventions and Visual Cues ................................................. 2 Typographical Conventions......................................................................................2 Visual Cues ..............................................................................................................3 Comments and Suggestions ........................................................................... 3 Business Function Programming Standards 4 Program Flow 5 Naming Conventions 6 Source and Header File Names...................................................................... 6 Function Names .............................................................................................. 7 Variable Names............................................................................................... 7 Example: Hungarian Notation for Variable Names ..................................................8 Business Function Data Structure Names ...................................................... 9 Readability 10 Maintaining the Source and Header Code Change Log ................................. 10 Inserting Comments ........................................................................................ 10 Example: Inserting Comments.................................................................................11 Indenting Code................................................................................................ 11 Example: Indenting Code.........................................................................................12 Formatting Compound Statements ................................................................. 12 Example: Formatting Compound Statements..........................................................13 Example: Using Braces to Clarify Flow....................................................................14 Example: Using Braces for Ease in Subsequent Modifications ...............................15 Example: Handling Multiple Logical Expressions ....................................................16 Declaring and Initializing Variables and Data Structures 17 Using Define Statements ................................................................................ 17 Example: #define in Source File ..............................................................................17 Example: #define in Header File..............................................................................18 Using Typedef Statements.............................................................................. 18 Example: Using Typedef for a User-Defined Data Structure ...................................18 Creating Function Prototypes.......................................................................... 19 Example: Creating a Business Function Prototype..................................................19 Example: Creating an Internal Function Prototype ..................................................20 Example: Creating an External Business Function Definition..................................20 Example: Creating an Internal Function Definition...................................................21 Initializing Variables ........................................................................................ 21 Example: Initializing Variables .................................................................................22 Initializing Data Structures .............................................................................. 24 Example: Using Memset to Reset the Data Structure to Null ..................................24 Using Standard Variables ............................................................................... 25 Flag Variables ..........................................................................................................25 Input and Output Parameters...................................................................................25 Fetch Variables ........................................................................................................25 Example: Using Standard Variables ........................................................................26 General Coding Guidelines 28 Using Function Calls ....................................................................................... 28 Calling an External Business Function ....................................................................28 Calling an Internal Business Function......................................................................29 Passing Pointers between Business Functions .............................................. 32 Store an Address in an Array...................................................................................32 Example: Storing an Address in an Array ................................................................32 Retrieve an Address from an Array..........................................................................33 Example: Retrieving an Address from an Array.......................................................33 Remove an Address from an Array..........................................................................33 Example: Removing an Address from an Array.......................................................33 Allocating and Releasing Memory................................................................... 34 Example: Allocating and Releasing Memory within a Business Function ...............34 Using hRequest and hUser ............................................................................. 34 Typecasting..................................................................................................... 35 Comparison Testing ........................................................................................ 35 Example: Comparison Test......................................................................................35 Example: Creating TRUE or FALSE Test Comparison that Uses Boolean Logic.........................................................................................................................36 Copying Strings with jdeStrcpy versus jdeStrncpy.......................................... 36 Using the Function Clean Up Area.................................................................. 37 Example: Using the Function Clean Up Area to Release Memory..........................37 Inserting Function Exit Points.......................................................................... 37 Example: Inserting an

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    118 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us