dbTalk Databases Forums  

Re: SwitchIndex syntax...?

comp.databases.paradox comp.databases.paradox


Discuss Re: SwitchIndex syntax...? in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Moseley
 
Posts: n/a

Default Re: SwitchIndex syntax...? - 02-10-2009 , 01:55 PM







Kenneth,

IIRC, switchIndex is used on uiObject & tcursors, not forms. So you need
to attach to a field on the form, then switch the field's index. Something
to the effect of:

var
newDate form
newUI uiObject
endVar
allIsWell = false
if newDate.open("newProgs") then
if newUI.attach(newDate.myFieldName) then
if newUI.switchIndex("startsOn") then
allIsWell = true
endif
endif
endif
if not allIsWell then
errorShow()
return
endif

HTH,
Jim Moseley

Reply With Quote
  #2  
Old   
Dennis Santoro
 
Posts: n/a

Default Re: SwitchIndex syntax...? - 02-10-2009 , 04:40 PM






Why open a new form instead of just switch index on the existing one
(unless it isn't the same table but your post implies it is)? You can
even trigger the switchindex from column headers so it works like what
folks are used to with an e-mail client and other such sortable forms.

I would also suggest you get in the happit of using aliases and not
assuming the WORK alias and not using the working directory as well as
adding error trapping to your forms as Jim showed you.

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and
non-profits since 1982

Kenneth wrote:
Quote:
On 10 Feb 2009 14:55:46 -0500, "Jim Moseley"
jmose (AT) mapson (DOT) attglobal.net> wrote:

Kenneth,

IIRC, switchIndex is used on uiObject & tcursors, not forms. So you need
to attach to a field on the form, then switch the field's index. Something
to the effect of:

var
newDate form
newUI uiObject
endVar
allIsWell = false
if newDate.open("newProgs") then
if newUI.attach(newDate.myFieldName) then
if newUI.switchIndex("startsOn") then
allIsWell = true
endif
endif
endif
if not allIsWell then
errorShow()
return
endif

HTH,
Jim Moseley

Hi Jim,

With your kind help, I have it working now.

As you said, it was the UIObject issue.

Thanks again,

Reply With Quote
  #3  
Old   
Steve Caple
 
Posts: n/a

Default Re: SwitchIndex syntax...? - 02-10-2009 , 05:44 PM



On Tue, 10 Feb 2009 17:40:05 -0500, Dennis Santoro wrote:

Quote:
Why open a new form instead of just switch index on the existing one
....

And, make sure you have a table management uiObject on the form - either
a tableFrame or MRO - and apply the switchIndex to THAT. I've always
considered it a failing of Paradox that switchIndex and other table level
operations work at all with a field, rather than a table ui object. But of
course, then the "Form Expert" wouldn't look so good . . .

--
Steve


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.