Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Paradox 5.0 - setRange

21 views
Skip to first unread message

Simon Weinfeld

unread,
Sep 23, 2004, 2:49:00 AM9/23/04
to corel.wpoffice.paradox-old_version

Greetings;

I have not used this forum from a while, and I do not know if it is still
being maintained and monitored by some of you Paradox experts. Maybe I need
to be redirected elsewhere.

I have a Table that contains 2 fields which are to be used to identify, and
select the upper and lower record numbers of the key field of the Master
Table used in a 1--M Form. I want to be able to use a Tcursor to read this
Table into the Form, identify these two as variables - 'Low' and 'High' to
be used in the 'Open' method of the Form. I made an attempt to use
'setRange' as follows, but it did not work.

var
DepTbl Tcursor
endVar

DepTbl.attach("Deposits.db")
DepTbl.setRange(Low,High)

Please help

Thank you
Simon
Los Angeles


Steven Green

unread,
Sep 23, 2004, 6:25:54 AM9/23/04
to corel.wpoffice.paradox-old_version

Simon Weinfeld wrote:

> I have not used this forum from a while, and I do not know if it is still
> being maintained and monitored by some of you Paradox experts.

yes, we're all still here..


> I made an attempt to use 'setRange' as follows, but it did not work.
>

> DepTbl.setRange(Low,High)

what error message?
are "low" and "high" the right types? (number, alpha, date, etc)


--
Steven Green - Waldorf Maryland USA

Diamond Software Group
http://www.diamondsg.com/main.htm
Paradox Support & Sales - Corel CTech Paradox
---------------------------------------------------
Diamond Sports Gems
http://www.diamondsg.com/gemsmain.htm
Trading Cards and other Sports Memorabilia
---------------------------------------------------

Simon Weinfeld

unread,
Sep 23, 2004, 12:36:03 PM9/23/04
to corel.wpoffice.paradox-old_version

Thanks for your response.
The answer to your question is, yes, They are declared as Number.
When I use the available interactive set range option in the filter setting
feature to manually enter the low and high range figures, it works. I now
want to be able to generate these low and high figures elsewhere, and
automatically use them in this form, through the use of ObjectPal.

Hoping to here from you shortly
Simon


"Steven Green" <gre...@diamondsg.com> wrote in message
news:4152A4B2...@diamondsg.com...

Bertil Isberg

unread,
Sep 23, 2004, 1:28:43 PM9/23/04
to corel.wpoffice.paradox-old_version

Simon

Please show where you assign values to High and Low, and tell us where they
are declared.

--
Bertil Isberg - CTECH
Paradox buglist:
online: http://w1.826.comhem.se/~u82608896/
FAQ newsgroup: corel.wpoffice.paradox-faq

simon weinfeld

unread,
Sep 23, 2004, 3:23:49 PM9/23/04
to corel.wpoffice.paradox-old_version

Here is a copy of the open method of the form (Form1).

method open(var eventInfo Event)
var
DepTbl,PmtTbl Table
ETC,STC Tcursor
Yr,Sbb,Sdn,
Edn,Spn,Epn Number
endVar


if eventInfo.isPreFilter() then
;// This code executes for each object on the form:

else
;// This code executes only for the form:
HideSpeedBar()
endif

ETC.open("Year.db")
STC.open("System.db")
ETC.NextRecord()
Yr = ETC."Current Year".value
STC.locate("Year",Yr)
Sbb = STC."Starting Bank Balance".value
Sdn = STC."Start Deposit No".value
Edn = STC."End Deposit No".value
Spn = STC."Start Payment No".value
Epn = STC."End Payment No".value
ETC.close()
STC.close()

DepTbl.attach("Deposits.db")
DepTbl.setRange(Sdn, Edn)

PmtTbl.attach("Payments.db")
PmtTbl.setRange(Spn, Epn)

endmethod


Please advise
Thank
Simon

Bertil Isberg <bertil.isberg@NOcomhemSPAMdotse> wrote in message
news:41530212_3@cnews...

Bertil Isberg

unread,
Sep 23, 2004, 4:43:55 PM9/23/04
to corel.wpoffice.paradox-old_version

Simon

<<
DepTbl.attach("Deposits.db")
DepTbl.setRange(Sdn, Edn)

PmtTbl.attach("Payments.db")
PmtTbl.setRange(Spn, Epn)
>>

DepTbl and PmtTbl are declared as table variables. A table variable is a
handle to a table behind the scene. Setting a range on a table behind the
scene, won't have any visual effects on your form. Your code in this case,
is just like a different user in a networked application.

You have to refer to design objects placed in your form, objects like a
tableframe (grid) or a multirecord object. If you don't have any of those
tablebound objects, you have to use a fieldobject. Watch for the names given
to the objects by Paradox. Most often you get the name of the table and the
name of the column in the table, but some characters like space is not
allowed in objectnames in a form, so such characters are replaced by an
underscore (_).

A last comment:
Objects in your form should not be manipulated until AFTER doDefault in the
form's open event. You cannot be sure they are known until the form has
opened.

simon weinfeld

unread,
Sep 23, 2004, 5:18:37 PM9/23/04
to corel.wpoffice.paradox-old_version

Bertil,
I am sorry but your reply did not mean much to me. I understand the
DoDefault concept, but that did not help.Are you suggesting that there is a
need to declare, in the Var the actual Table Frame that is "seating" in the
form, rather than the table itself ? How do I do that ?

As I already indicated, when I first took advantage of the 'interactive' -
non ObjPal approach, and mannually placed the range figures in the filter
dialouge box, it worked fine. I am now trying to, more automatically pass
these low and high parameters through ObjPal.

Please Help
Simon

Bertil Isberg <bertil.isberg@NOcomhemSPAMdotse> wrote in message

news:41532fd2_2@cnews...

Bertil Isberg

unread,
Sep 24, 2004, 3:38:16 AM9/24/04
to corel.wpoffice.paradox-old_version

Simon

<<
Are you suggesting that there is a
need to declare, in the Var the actual Table Frame that is "seating" in the
form, rather than the table itself ? How do I do that ?
>>
If the table is shown in the form as a tableframe object or a
multirecord object, that obejct has a name. Select the object and the
statusbar will tell you the name of the object, like Customer[TableFrame].

That object can be used in ObjectPAL without being declared. By default
it is a user-interface object, the ObjectPAL type is uiObject.

Create a new form. Add the table Deposits to the datamodel, and select a
tabular design layout, so you get a tableframe object. Select the
tableframe object, and you'll see it is named Deposits.

In ObjectPAL, form's open event, you can add code in the else clause

doDefault
Deposits.setRange(1, 1000) ; or whatever values

That's all that's needed. No declaration at all.

In the ObjectPAL help, you can find information on setrange(). Look at
the uiObject type setrange(), and the example:

Code below is form the help files. I have added comments to it
var
tblObj UIObject
endVar
; 1 BI In this case the programmer has decided to use a uiObject
; it's not really needed.


if tblObj.attach(LINEITEM) then
; 2 BI As a variable is declared it has to be initialized
; by being attached to the object in the form.
; Note: Name is unquoted
; COREL: this limits tblObj's view to records that have
; COREL: 1005 as their key value (Order No. 1005).
tblObj.setRange(1005, 1005)
; COREL: now display the number of records for Order No. 1005
msgInfo("Total records for order 1005", tblObj.nRecords())
else
msgStop("Sorry", "Can't attach to table.")
endIf

This code could have written:
; 1 BI No declaration
; 2 BI No attach
; Just two lines of code

LINEITEM.setRange(1005, 1005)
; 3 BI By default LINEITEM is a uiObject
msgInfo("Total records for order 1005", LINEITEM.nRecords())

If you want to get at data from tables no included in your datamodel,
you can declare a table variable or a tcursor variable to read and edit
data. Table variables are mainly used for the table operations you can
do when right clicking a table in ProjectViewer, that is add, subtract,
copy, empty. tCursors are mainly used for what you do in a table
interactively, searching, scrolling, editing data.


--
Bertil Isberg
CTECH
FAQ newsgroup: corel.wpoffice.paradox-faq
Paradox Buglist: http://w1.826.comhem.se/~u82608896/

remove spamfilter (reversed) to reply


simon weinfeld

unread,
Sep 24, 2004, 2:14:21 PM9/24/04
to corel.wpoffice.paradox-old_version

Thank you. It works.

Thanks for being there
Simon

Bertil Isberg <bertil...@retlifmapsSCB.se> wrote in message
news:4153c8fa_3@cnews...

0 new messages