I.T. Discussion Community!
-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
-Collapse +Expand Paradox To/From
To/FromCODEGuides
-Collapse +Expand Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

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

   ► KBDesktop Data...Paradox & Ob...ObjectPAL Co...   Print This     
  From the January 2015 Issue of Prestwood eMag
 
Paradox ObjectPAL Coding:
How To Make Programmed Paradox Queries With Microsoft Notepad
 
Posted 32 months ago on 12/15/2014
Take Away:

Takeaway: This article discusses a technique I use to create objectPAL queries that can easily be modified for other purposes such as customized reporting.

KB102710



INTRODUCTION

Everyone knows how useful Paradox queries can be for extracting data in a variety of ways. Many people who use this versatile database software package know how to make all kinds of queries. But what if you want to take the queries you already have to the next level and weave them into an objectPAL programming task without a lot of hassle?

Here, I will discuss a technique I use for doing this and it’s much easier than you think!

FIRST, GRAB THE PROGRAMMING FROM THE PARADOX QUERY

You need to go into Paradox and right click the query you want the programming for. Next, click “Edit” on the pop up menu and you should see the query’s underlying programming code in the Microsoft Notepad application found on all Windows computers. Here is what the code for a query looks like after following these steps:

 

 


Query

ANSWER: :PRIV:ANSWER.DB

 

:CUSTOMER:Invoice.DB | INVOICENO | INVOICE DATE | PAID AMOUNT |

                     | Check     | Check        | Check       |

 

:CUSTOMER:Invoice.DB | PAID CODE | DISCOUNT | COMPANY |

                     | Check     | Check    | Check   |

 

EndQuery


The next step is to block or highlight the main part of the query programming, excluding the “Query” and “EndQuery” portions. Then copy it using “Edit->Copy” from Microsoft Notepad’s menu bar or the “CONTROL->C” key combination.

NEXT, INTEGRATE THE QUERY’S PROGRAMMING INTO YOUR objectPAL CODE

Now you need to paste the copied selection of programming from the query into your objectPAL Paradox application. Position your cursor at the location in the objectPAL code where you want the query to execute and then use the “CONTROL->V” key combination to paste the code. See the sample code below:

 

 


method pushButton(var eventInfo Event)

var

      qVar              Query

      tc,

      tc2               TCursor

endVar

 

.

.

.

.

.

 

qVar = Query

 

 :CUSTOMER:Invoice.DB | INVOICENO | INVOICE DATE | PAID AMOUNT |

                      | Check     | Check        | Check       |        

 

 :CUSTOMER:Invoice.DB | PAID CODE | DISCOUNT | COMPANY |

                      | Check     | Check    | Check   |

 

EndQuery

 

 

 

qVar.executeQBE(":CUSTOMER:GenericQuery.db")

 

 

 

if tc.open(":CUSTOMER:TemporaryTable.db") And tc2.open(":CUSTOMER:GenericQuery.db") then

 

tc.empty()

tc.edit()

 

while NOT tc2.eot()

 

.

.

.

.

 

(Further processing code goes here)

 

.

.

.

.

 

tc2.nextRecord()

 

endWhile

 

endif

 

tc.endEdit()

tc.close()

tc2.close()

 

.

.

.

.

.

 

endMethod

 

 


The above objectPAL code shows how I inserted the main programming code from the query into an objectPAL pushbutton event in a Paradox form. At this point, feel free to modify the programmed query by adding more result fields and filtering criteria.

Notice the query is preceded by qVar = Queryand followed by EndQuery”. qVar is an objectPAL query object used to programmatically execute the query. The results are then stored in the “GenericQuery” data table in the folder represented by the “CUSTOMER” alias via the objectPAL directive, qVar.executeQBE.

Next, the “GenericQuery” data table is used in conjunction with Tcursor objects “tc” and “tc2” to perform more specialized operations with the results of the executed query.

CONCLUSION

The objectPAL queries are excellent vehicles for performing large data extraction operations, because they run much more quickly than by trying to do the same thing with Tcursors. Specific programming chores that queries by themselves may not be well suited for can be handled by Tcursor objects. Integrating the underlying code of a query into an objectPAL custom software task is the best approach. Most people don’t like to wait prolonged periods of time for code to process large blocks of data. objectPAL queries are instrumental in helping you overcome this issue.


Comments

1 Comments.
Share a thought or comment...
Comment 1 of 2

how to make application like autopilot trader program using only notepad?

---
WENDELL SANTOS
Posted 16 months ago

Comment 2 of 2

That's true, I was just saying that NOTEPAD is a quick, easy veicle for transferring the QBE code to an OBJECTPAL script under one of object explorer's events within the FSL form. The aliases in the code from NOTEPAD reference the already set up data tables to be used in the query.

Posted 5 months ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1164A1
Enter key:
Article Contributed By Douglas.M:

Please visit my software developer website for more information about my services. I offer application development as well as Android app coding services. My developer skills are best suited to dealing with custom software projects. I can perform programming for Corel Paradox as well as C# Sharp and PHP.

In my local area of northeast Ohio, I can cater to computer repair and "fix my computer" issues.

Use my contact web page today to reach me about any software design ideas you have.

Be sure to check out my blog on Tumblr.

Visit Profile

 KB Article #102710 Counter
4225
Since 12/15/2014
-
   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,072 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