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.
None
New CodeSnippets:
|
KB Article |
|
John Andres
|
1. open table
(6 Comments
, last by Pervez.J )
|
 Code
 2436 Hits
|
 Corel Paradox / ObjectPAL Coding
|
Bryan Valencia
|
2. 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.
(1 Comments
, last by Theessay.S )
|
 Code |
 KB Post |
 8199 Hits
|
 DBA, Databases, & Data
|
Ahmed.A
|
3. 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
(4 Comments
, last by deena.d )
|
 Code
 12898 Hits
|
 Pascal and Delphi Coding
|
Mike Prestwood
|
4. 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.
|
 Code
 11203 Hits
|
 PHP & Delphi for PHP
|
Mike Prestwood
|
5. 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.
|
 Code
 12909 Hits
|
 Perl
|
Mike Prestwood
|
6. 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", "")%>
(7 Comments
, last by Natalie.Z )
|
 Code
 9691 Hits
|
 ASP Classic Coding
|
Bryan Valencia
|
7. 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.
(2 Comments
, last by Hanvi.j )
|
 Code
 20300 Hits
|
 C# (Visual C# & VS.Net)
|
Mike Prestwood
|
8. Delphi Array (x=Array[0..3] of string;)
Delphi supports both static and dynamic arrays.
(3 Comments
, last by hememo6399.h )
|
 Code |
 KB Post |
24327 Hits
|
 Pascal and Delphi Coding
|
Mike Prestwood
|
9. 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.
(5 Comments
, last by Venyer.T )
|
 Code |
 KB Post |
18524 Hits
|
 Corel Paradox / ObjectPAL Coding
|
Mike Prestwood
|
10. 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.
|
 Code
12059 Hits
|
 Visual Basic Classic
|
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.
15 years ago, and updated 14 years ago
(2 Comments
, last by Jeorge.W )
|
 Code |
 KB Post |
18096 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.
17 years ago, and updated 14 years ago
(5 Comments
, last by sophie.e )
|
 Code |
 Article |
 29389 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.
18 years ago, and updated 15 years ago
(3 Comments
, last by funny.j )
|
 Code
 11609 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.
16 years ago, and updated 15 years ago
(4 Comments
, last by Eugene.P )
|
 Code |
 Article |
49093 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
17 years ago, and updated 15 years ago
|
 Code |
 KB Post |
 14856 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).
17 years ago, and updated 15 years ago
(2 Comments
, last by mprestwood )
|
 Code
 13391 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.
|
 Code
 20693 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.
16 years ago, and updated 15 years ago
(2 Comments
, last by Anonymous )
|
 Code |
 Article |
 28879 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.
17 years ago, and updated 15 years ago
(2 Comments
, last by Jesse.L )
|
 Code
15656 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.
16 years ago, and updated 15 years ago
(1 Comments
, last by Leo.M )
|
 Code |
 Article |
31302 Hits
|
 Pascal and Delphi Coding
|
|
|