I.T. Discussion Community!
-Collapse +Expand
KB
Tech Search:

Advanced

Prestwood eMagazine

November Edition
Subscribe now! It's Free!
Enter your email:

   ► KBKnowledge Base   Print This     

Prestwood Code Snippet Database

Member-driven Prestwood Code Snippet Database. Your participation is requested!

Browse by category...

Each list is compiled from the cooresponding community group.

IT Professionals:
  • DBA Code
  • Desktop Databases:
  • Access Code
  • Paradox Code
  • Website Scripting:
  • ASP Classic Code
  • Design Code
  • JavaScript Code
  • Perl Code
  • PHP Code
  • General Dev Tools:
  • C# Code
  • C++ Code
  • Delphi Code
  • Java Code
  • Prism Code
  • VB Classic Code
  • VB.Net Code

  • New CodeSnippets:

      KB Article  

    Bryan Valencia
    1. Easy SQL Server Backup Script

    Learn how to make an easy SQL Server Script that will automatically back up all your databases in a simple way.

    Posted to KB Topic: Microsoft SQL Server
    54 months ago
    (1 Comments , last by Theessay.S )

    Code

    KB Post
    Nothing New Since Your Last Visit
    4644
    Hits

    DBA, Databases, & Data

    Ahmed.A
    2. BDE Paradox Robust table openning

    This is a rough draft version of a procedure that provides a robust way to open paradox tables in a delphi program

    Posted to KB Topic: BDE
    6 years ago

    Code
    Nothing New Since Your Last Visit
    9508
    Hits

    Pascal and Delphi Coding

    Mike Prestwood
    3. PHP Constants (define)

    In PHP, you declare constants using the define keyword:

    define("CONST_NAME", "Value");

    Constants in PHP are case sensitive. A common standard in PHP is to use all-uppercase letters, with underscores to separate words within the name.

    Posted to KB Topic: PHP
    7 years ago

    Code
    Nothing New Since Your Last Visit
    6675
    Hits

    PHP & Delphi for PHP

    Mike Prestwood
    4. Perl Constants (use constant)

    In PHP, you declare constants using the define keyword:

    define("CONST_NAME", "Value");

    Constants in PHP are case sensitive. A common standard in PHP is to use all-uppercase letters, with underscores to separate words within the name.

    Posted to KB Topic: Perl
    7 years ago

    Code
    Nothing New Since Your Last Visit
    7543
    Hits

    Perl

    Mike Prestwood
    5. ASP Classic Yes/No Function

    The following function demonstrates one technique for coding a Yes/No dropdown. It uses a for loop which can be expanded to handle more than the 3 states (Y, N, and blank).

    Example of calling the function:

    Do you fish? <%=YesNoDropDown("ynFish", "")%>
    Posted to KB Topic: ASP Classic
    7 years ago

    Code
    Nothing New Since Your Last Visit
    5536
    Hits

    ASP Classic Coding

    Bryan Valencia
    6. Consuming an RSS feed in ASP.NET

    Using this quickie code snippet, you can attach an ASP:Gridview  to an external RSS Feed.

    All you need to accomplish this is the URL of a usable feed.

    Posted to KB Topic: WebForms Coding Tasks
    7 years ago
    (1 Comments , last by Louis.M )

    Code
    Nothing New Since Your Last Visit
    16729
    Hits

    C# (Visual C# & VS.Net)

    Mike Prestwood
    7. Delphi Array (x=Array[0..3] of string;)

    Delphi supports both static and dynamic arrays.

    Posted to KB Topic: Delphi for Win32
    7 years ago
    (2 Comments , last by Anonymous )

    Code

    KB Post
    Nothing New Since Your Last Visit  
    15379
    Hits

    Pascal and Delphi Coding

    Mike Prestwood
    8. ObjectPAL Array (Array[] type)

    Arrays in ObjectPAL use a 1-based indice.

    Use size() to get the number of elements. size() returns 0 if the array has no elements.

    Posted to KB Topic: Paradox & ObjectPAL
    7 years ago

    Code

    KB Post
    Nothing New Since Your Last Visit  
    11734
    Hits

    Corel Paradox / ObjectPAL Coding

    Mike Prestwood
    9. VB Classic Array (x = Array())

    Arrays in VB Classic use a 0-based indice. UBound returns -1 if the array has no elements, 0 if it has 1, 1 if it has 2, etc.

    Posted to KB Topic: VB Classic
    7 years ago

    Code
    Nothing New Since Your Last Visit  
    7834
    Hits

    Visual Basic Classic

    Mike Prestwood
    10. ASP Classic Array (x = Array())

    Arrays in ASP Classic use a 0-based indice.

    Use UBound to get the number of elements. UBound returns -1 if the array has no elements, 0 if it has 1, 1 if it has 2, etc.

    Posted to KB Topic: ASP Classic
    7 years ago, and updated 6 years ago

    Code

    KB Post
    Nothing New Since Your Last Visit  
    11435
    Hits

    ASP Classic Coding

    Updated CodeSnippets:

      KB Article  

    Mike Prestwood
    1. ASP Classic Array (x = Array())

    Arrays in ASP Classic use a 0-based indice.

    Use UBound to get the number of elements. UBound returns -1 if the array has no elements, 0 if it has 1, 1 if it has 2, etc.

    Posted to KB Topic: ASP Classic
    7 years ago, and updated 6 years ago

    Code

    KB Post
    Nothing New Since Your Last Visit  
    11435
    Hits

    ASP Classic Coding

    Mike Prestwood
    2. Delphi Abstraction (abstract, override)

    Delphi for Win32 supports abstract class members using the abstract keyword. You can even instantiate instances of a class that contains abstract members. Then you override each abstract member in a descendant class with Override. Delphi does not support setting an entire class as abstract. You can create an abstract class (a class with one or more abstract methods), but there is no way to tell the compiler to not allow the instantiation of the abstract class. Delphi does not support abstract member properties directly. To implement an abstract properity, make use of abstract methods. That is, you can read a GetPropertyX abstract function and write to a SetPropertyX abstract procedure. In effect, creating  an abstract property.

    Posted to KB Topic: OOP
    9 years ago, and updated 6 years ago
    (4 Comments , last by Uwais.Q )

    Code

    Article
    Nothing New Since Your Last Visit
    19121
    Hits

    Pascal and Delphi Coding

    Mike Prestwood
    3. ObjectPAL setTitle()

    This code sets the title of your Paradox application in the application's title bar.

    Posted to KB Topic: OPAL: Commands
    10 years ago, and updated 7 years ago
    (1 Comments )

    Code
    Nothing New Since Your Last Visit
    7605
    Hits

    Corel Paradox / ObjectPAL Coding

    Mike Prestwood
    4. ASP Classic Empty String Check (Len(s&vbNullString))

    In ASP Classic, you have to add an empty string to the value being compared in order to get consistent results. For example, add &"" to your string varilable or it's code equivalent &vbNullString. Then compare to an empty string or verify it's length to 0 with Len.

    Posted to KB Topic: ASP Classic
    8 years ago, and updated 7 years ago
    (3 Comments , last by mprestwood )

    Code

    Article
    Nothing New Since Your Last Visit  
    34976
    Hits

    ASP Classic Coding

    Mike Prestwood
    5. Perl Variables ($x = 0;)

    Perl is a loosely typed language with only three types of variables: scalars, arrays, and hashes. Use $ for a scalar variable, @ for an array, or % for a hash (an associative array). The scalar variable type is used for anytype of simple data such as strings, integers, and numbers. In Perl, you identify and use a variable with a $ even within strings

    Posted to KB Topic: Beginners Corner
    9 years ago, and updated 7 years ago

    Code

    KB Post
    Nothing New Since Your Last Visit
    7818
    Hits

    Perl

    Mike Prestwood
    6. Delphi Prism Member Property (property..read..write)

    Like Delphi, Delphi Prism uses a special property keyword to both get and set the values of properties. The read and write keywords are used to get and set the value of the property directly or through an accessor method. For a read-only property, leave out the write portion of the declaration.

    You can give properties any visibility you wish (private, protected, etc). It is common in Delphi and Delphi Prism to start member fields with "F" ("FName" in our example) and drop the "F" with properties that manage member fields ("Name" in our example).

    Posted to KB Topic: OOP
    9 years ago, and updated 7 years ago
    (2 Comments , last by mprestwood )

    Code
    Nothing New Since Your Last Visit
    8180
    Hits

    Delphi Prism

    Mike Prestwood
    7. ASP Classic Edit Record (AddNew, Update, Delete)

    In ASP, using ADO, you use RecordSet.AddNew to add a new record, Recordset.Update to post the record, and RecordSet.Delete to delete it. To edit a record, you open the RecordSet using an editable cursor.

    Posted to KB Topic: ASP Classic
    7 years ago

    Code
    Nothing New Since Your Last Visit
    14869
    Hits

    ASP Classic Coding

    Mike Prestwood
    8. Delphi Overriding (virtual, override)

    In Delphi, you specify a virtual method with the virtual keyword in a parent class and replace it in a descendant class using the override keyword. Call Inherited in the descendant method to execute the code in the parent method.

    Posted to KB Topic: OOP
    8 years ago, and updated 7 years ago
    (2 Comments , last by Anonymous )

    Code

    Article
    Nothing New Since Your Last Visit
    17453
    Hits

    Pascal and Delphi Coding

    Mike Prestwood
    9. ObjectPAL Variables (var x SmallInt endVar)

    Declaring variables is optional unless you click Program | Compiler Warnings while in the ObjectPAL editor for every form, script, and library you create. Using Compiler Warnings is strongly recommended to avoid incorrectly typing an existing variable and to avoid any confusion about variable scope. Also recommended is turning on Compile with Debug for every form, script, and library too for tighter, cleaner code.

    Undeclared variables are AnyType variables. Common data types include Currency, Date, Datetime, Logical, LongInt, Number, SmallInt, String, and Time.

    Declare local variables within a method. If you want a local static variable (retains it's value because it is not destroyed), declare the varialbes above the method. Variables declared in an object's Var window are visible to all methods attached to that object, and objects that it contains.

    Posted to KB Topic: OPAL: Language Basics
    9 years ago, and updated 7 years ago
    (1 Comments , last by marianchovan )

    Code
    Nothing New Since Your Last Visit  
    9412
    Hits

    Corel Paradox / ObjectPAL Coding

    Mike Prestwood
    10. Delphi Class Helpers (class helper for)

    Delphi allows you to extend an existing class without using inheritance. Buggy in 2005 and not officially supported but stable and usable in 2006 and above. You declare a class helper similiar to how you declare a class but use the keywords class helper for.

    • You can name a helper anything.
    • Helpers have access only to public members of the class.
    • You cannot create an object instance directly from a class helper.
    • self refers to the class being helped.
    Posted to KB Topic: OOP
    8 years ago, and updated 7 years ago

    Code

    Article
    Nothing New Since Your Last Visit  
    20539
    Hits

    Pascal and Delphi Coding
    -
       Contact Us!
     
    PrestwoodBoards.com was developed and is maintainted by me. Do you have a question or suggestion? Do you see a problem? Contact me now. My goal is to build an ad-free and spam-free source of I.T. information with many contributers (ok to promote your website/company in your bio). Yes, my company Prestwood IT Solutions is mentioned in my bio which shows with every post, but you can contribute and promote your pet project too!

    2,301 People Online Now!!  
    Sign In to see who's online now!  Not a member? Join now. It's free!
    Show more stats...


    ©1995-2017 PrestwoodBoards  [Security & Privacy]
    Professional IT Services: Coding | Websites | Computer Tech