At 08:41 AM 10/17/2003 -0700, you wrote:
I don't think that you can use & when defining your form var's or in the where
clause for popups.
Yah, thats what I was afraid of. I know I can do it in the command file, (thats where they are all now, and working just fine).. however the problem is speed.
I am copying a form that we already use, (recreating one like it) The original sets the variables in the form, however the table is just named, rather than referred to in a variable. ie..
Tech10 = .techview FROM servcall WHERE invoice is null AND serdat = .vardate1 AND cellno = "a0"
This works just fine.... (there are a total of 90 variables that have to get updated anytime any thing happens, so a recalc variables is issued)
Now to make the code more usefull and allow the variables to be updated from either the current, or history table, and set the Where differently depending on what was desired. (currently, we just use three different forms to do that)
So I use the code:
Set V Tech10 = .techview FROM &techtable1 WHERE &techwhere AND serdat = .vardate1 AND cellno = "a0"
in a command file (repeated once for every one of the 90 variables).
The new form works perfectly using the variables for the tablename and for the where clause.. however it takes four to five times longer to recalc the variables. I am assuming that they would recalc faster if they were in the form rather than in the command file.
Maybe this isn't so. Dan
But you can run an eep in table settings that set those table vars up and then
an eep that uses choose box and the var you setup in the other eep and get the
same afect as a popup
This is a piece of a work exsample from my database. You could use the basic logic just about anyway you would like.
eep 1
SET VAR vWhereStyle_1 TEXT = 'WHERE CatID = .vCatID'
SELECT Width_PCat_YN INTO vWidth_PCat_YN INDIC ivWidth_PCat_YN FROM Categories
WHERE CatPrefix = .vCatPrefix
IF .vWidth_PCat_YN = 'N' THEN SET VAR vWidthWhere TEXT = .vWhereStyle_1 ELSE SET VAR vWidthWhere TEXT = .vWhereStyle_2 ENDIF
------------------------------------------------------------------------------- eep 2 IF vOptions = 3 THEN CHOOSE vWidthID1 FROM #Values FOR(WidthDesc),WidthID FROM ProductWidth &vWidthWhere IF vWidthID1 FAILS OR vWidthID1 = '[Esc]' THEN GOTO DONE ENDIF SET VAR vWidthID INTEGER = .vWidthID1 UPDATE PartsList SET WidthID = .vWidthID WHERE ItemID = .vItemID GOTO Done ENDIF
On 17 Oct 2003 at 8:52, Dan Champion wrote:
> Hi all,
> I have a program that sets 90 variables that I use in a form:
>
> Set V Tech10 = .techview FROM &techtable1 +
> WHERE &techwhere AND serdat = .vardate1 AND cellno = "a0"
>
> I decided for speed that it would be better to create the variable in a
> form rather than in the command file.
> I tried to ADD/EDit variable:
>
> Tech10 = .techview FROM &techtable1 WHERE &techwhere AND serdat =
> .vardate1 AND cellno = "a0"
> And I get the error that the table &Techwhere doesn't exist. I use a
> variable to describe which table, so that I can change the table on the fly.
> Any work-arounds come to mind?
> I need to be able to use either of two tables for that (and all other 89
> variables)
> Thanks for your help
> Dan
>
>
> Dan Champion
> www.championsolutions.net
>
>
Victor Timmons Tiz's Door Sales, Inc 425-258-2391
Dan Champion www.championsolutions.net

