So we saw this error pop up elsewhere in our beta test of v16 under the
same circumstances:

Error:"A variable was expected"
the line of code is: SET QUERY DESTINATION(Into variable;$LQueryResult)

Looking at the Unique Values project method in the example on this page:
http://doc.4d.com/4Dv16/4D/16.3/SET-QUERY-DESTINATION.301-3651871.en.html
led me to believe that I could declare the destination variable as a
C_LONGINT.

I added a declaration for the local variable $LQueryResult and the method
ran without a problem.

So has the behavior of SET QUERY DESTINATION changed in such a way that
(contrary to what is in the documentation), the variable must exist before
the method is called?



On Thu, Aug 2, 2018 at 7:12 AM Chip Scheide via 4D_Tech <
[email protected]> wrote:

>
> > In addition to consistency & clarity in showing variable type, do you
> from my 'Conventions' (all comment) method
>
>   //Variables
>   //all process or interprocess vars are preceded by a type designator
>   //I do not hold these conventions for local variables
>   //this is in the form of :
>   //    letter(s)_variablename
>   //    letters for designator are always lower case
>
>   //Variable names are always 1 word, with separate 'phrases' connected
> by an underscore
>   //the first letter of each 'phrase' is always capitalized.
>   //ex: al_My_Longint_Array
> variable naming specifics are NOT included here....
>
> >do you
> > put   any / much / no   thought into using the variable names to
> > indicate business―vs technical―purpose?
>
> Depending on the code usage, it is not always possible to separate the
> 2 things - technical vs Business. If the code is generic (like might be
> found in a component) then the primary consideration for variable
> naming will be technical usage; however, Reporting, and/or user
> interface most often the usage in the interface is the paramount
> consideration for variable naming.
>
> i.e.
> Component : $Array_Pointer, $Loop_Counter, $Return_value
> Interface : r_Invoice_Line_Total, r_Invoice_Grand_total,
> l_Line_Item_Count
>
> For code that spans the gap, naming will be what seems to make the most
> sense. I *try* to make the code as readable, and 'self documenting' as
> possible, even in generic code I try to avoid code like this
> (completely made up):
>
> For ($i;1;$x)
>   $y:= $z+$A+$f*$t/$R+$G-$k
>   $v:=$y+$v
> end for
>
> and prefer code more like this (also made up):
>
> $Record_Count := Records in set("SomeSetName")
> ....
> For($i;1;$Record_Count)
>   $Record_Total:= [table]Field1 *[table]Field2) + ([table]Field3 /
> [table]Field4)
>   $Grand_Total := $Grand_Total + $Record_Total
>   next record([table])
> end for
>
>
>
>
> On Wed, 1 Aug 2018 21:17:40 -0400, David Eddy via 4D_Tech wrote:
> >
> >
> >> On Aug 01, 2018, at 3:00 PM, Jody Bevan <[email protected]
> >> <mailto:[email protected]>> wrote:
> >>
> >>
> >> 2. The naming convention must clearly show the type of variable.
> >
> > In addition to consistency & clarity in showing variable type, do you
> > put   any / much / no   thought into using the variable names to
> > indicate business―vs technical―purpose?
> >
> > ____________________________
> > David Eddy
> > Babson Park, MA
> >
> > W: 781-455-0949
> >
> > [email protected] <mailto:[email protected]>
> > **********************************************************************
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:[email protected]
> > **********************************************************************
> ---------------
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to