Fwd: Re: Building a selection set on the fly
Transpower
transpower at aol.com
Wed Feb 23 10:54:19 PST 2005
-------- Original Message --------
Subject: Re: Building a selection set on the fly
Date: 2/23/2005, 1:50 PM
From: Transpower <transpower at aol.com>
To: Don Coleman <dcoleman at dgcreact.com>
cc: filepro-list at celestial.com
Organization: Transpower Corporation
Don Coleman wrote on 2/23/2005, 1:31 PM:
> Nancy Palmquist wrote:
>
> > Don Coleman wrote:
> >
> >> List:
> >>
> >> I use the code posted below to build a small 3 line selection set on
> >> the fly. Now, for one customer, my client needs me to add a fourth
> >> selection criteria. On the line
> >> if 9 eq "MTSP
> >> then goto montana
> >> *report errors out on the write use;close use located on line #30.
> >> Can anyone see what I am doing wrong on lines 27-28 that is causing
> >> this problem? The only difference is when filling in the use(5)
> >> field. I manually set up the selection set and opened it with a text
> >> editor and it looks as I would expect it to look. It passes the
> >> syntax check but errors out at run-time with a memory error on
> >> multiple PC's. If field 9 ne "MTSP" the program still functions
> >> fine. fPv5.0.13 on Win98SE and XP Pro clients, Win2000 Advanced
> >> Server. The sample code below is from the -v (select) process.
> >>
> >>
> >> 19 ------- - - - - - - - - - - - - - -
> >> - -
> >> noctl If:
> >> Then: RF="E:\QS1\TODO\FILEPRO\QS1\DOUBLE.SEL"{""
> >> 20 ------- - - - - - - - - - - - - - -
> >> - -
> >> If:
> >> Then: 'RF="C:\RXPRISON\FILEPRO\QS1\DOUBLE.SEL"{""
> >> 21 ------- - - - - - - - - - - - - - -
> >> - -
> >> If: 9 eq "MTSP"
> >> Then: goto montana
> >> 22 ------- - - - - - - - - - - - - - -
> >> - -
> >> If:
> >> Then: export ascii use=(RF) f=\n
> >> 23 ------- - - - - - - - - - - - - - -
> >> - -
> >> If:
> >> Then: use(1)="";use(2)=":9:eq:"{AB;use(3)=":150:eq:"{"Y"
> >> 24 ------- - - - - - - - - - - - - - -
> >> - -
> >> If:
> >> Then:
> >> use(4)=":66:eq:"{@td;use(5)="";use(6)=":::";use(7)=":::";use(8)="::
> >> :";use(9)=":::"
> >> 25 ------- - - - - - - - - - - - - - -
> >> - -
> >> If:
> >> Then:
> >> use(10)=":::";use(11)=":::";use(12)=":::";use(13)=":::";use(14)="
> >> ";goto finsel
> >> 26 ------- - - - - - - - - - - - - - -
> >> - -
> >> montana If:
> >> Then: use(1)="";use(2)=":9:eq:"{AB;use(3)=":150:eq:"{"Y"
> >> 27 ------- - - - - - - - - - - - - - -
> >> - -
> >> If: AC eq "A"
> >> Then:
> >> use(4)=":66:eq:"{@td;use(5)=":4:eq:"{"JBP";use(6)=":::";use(7)=":::
> >> ";use(8)=":::";use(9)=":::"
> >> 28 ------- - - - - - - - - - - - - - -
> >> - -
> >> If: AC eq "D"
> >> Then:
> >> use(4)=":66:eq:"{@td;use(5)=":4:ne:JBP;use(6)=":::";use(7)=":::
> >> ";use(8)=":::";use(9)=":::"
> >> 29 ------- - - - - - - -
> >
> >
> > On a selection table you do not enter quotes. You just need to put
> JBP.
> >
> > If you want quotes, you type \"JBP\"
> >
> > - - - - - - - - -
> >
> >> If:
> >> Then:
> >> use(10)=":::";use(11)=":::";use(12)=":::";use(13)=":::";use(14)="
> >> "
> >> 30 ------- - - - - - - - - - - - - - -
> >> - -
> >> finsel If:
> >> Then: write use;close use
> >>
> >> Thanks,
> >>
> >> Don Coleman
> >> _______________________________________________
> >> Filepro-list mailing list
> >> Filepro-list at lists.celestial.com
> >> http://mailman.celestial.com/mailman/listinfo/filepro-list
> >>
> >>
> >
> >
> Nancy:
>
> I tried it both ways,
> w/o the quotes use(5)=":4:eq:"{"JBP"
> and with the backslashes & quotes use(5)=":4:eq:"{\"JBP\"
>
> both methods fail the syntax check. Am I misunderstanding?
>
> Don Coleman
> _______________________________________________
Dan:
If you have access to TrueBASIC you could use something like the
following code:
DIM selline$(28)
OPEN #3: name "\filepro\model\default.sel", ACCESS OUTIN, ORGANIZATION TEXT
LET i = 0
DO WHILE MORE #3
LET i = i + 1
IF i > UBOUND(selline$) then EXIT DO
LINE INPUT #3: selline$(i)
LOOP
ERASE #3
LET selline$(2) = ":50:EQ:" & exprevid$ [the value]
FOR j = 1 TO i [i is UBOUND(selline$)]
PRINT #3: selline$(j)
NEXT j
CLOSE #3
So this code snippet reads in the existing selection table to selline$.
It makes the change in line 2 (of course you could change whatever
lines you wanted to whatever values). It then prints all the lines of
the selection table back to disk.
RWS
Transpower Corporation, www.transpowercorp.com, transpower at aol.com
Commercial and Custom Software Manufacturing Since 1976
SCO Authorized and Microsoft Certified Systems Engineering
More information about the Filepro-list
mailing list