string->invoke(string) error

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

string->invoke(string) error

Marc Pinnell-3
Maybe I have been looking at this too long... The code below is generating this error:

Lasso Error Code: -9948
Error Description: Definition Not Found: string->invoke(string) Candidates were: null->invoke()
Error Stack:
301:64 //.../admin-reservations-home.lasso


local(
        curRes = #quadTime->get(loop_count),
        rowsc = $reservations->find(#curRes)->get(4),
        colsc = $reservations->find(#curRes)->get(5)
        )

match($reservations->find(#curRes)->get(3)) => {^
        case(TRUE)
                '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc + '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) + '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
        case(FALSE)
                '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc + '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) + '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
^}


* Line 301 is the "td" line under TRUE, position 64 would be the second occurrence of "#rowsc" in that line.
* #rowsc is an integer (verified)
* Removing #rowsc shifts the error forward to the second occurrence of #colsc, which is also an integer
* Changing #rowsc to #rowsc->asString (in the second occurrence) changes nothing

Help! Probably something stupid easy, but I have been staring at it too long.

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Jolle Carlestam-2
This would be the culprit. Are you missing a + sign?

HDB
Jolle

Sent from a mobile device. Any anomalies is due to Autocorrect.

> 21 jan 2015 kl. 19:45 skrev Marc Pinnell <[hidden email]>:
>
> '"')(#colsc

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Brad Lindsay
Definitely missing a + sign between the two ternaries.

Brad

On January 21, 2015 at 2:36:14 PM, Jolle Carlestam ([hidden email]) wrote:

> This would be the culprit. Are you missing a + sign?
>
> HDB
> Jolle
>
> Sent from a mobile device. Any anomalies is due to Autocorrect.
>
> > 21 jan 2015 kl. 19:45 skrev Marc Pinnell :
> >
> > '"')(#colsc
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to:
> Send administrative queries to
>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

stevepiercy
In reply to this post by Marc Pinnell-3
When you can't read your own code, it's a sign that you should
modify it.  Additionally, it will identify on precisely which
line you have a syntax error.  A long single line of string
concatenation makes it harder to find the error.

local(output) = string
match($reservations->find(#curRes)->get(3)) => {
     case(true)
         #output->append('<td class="reserved success"')
         #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
         #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
         #output->append('><a href="/admin/edit+reservation/')
         #output->append($reservations->find(#curRes)->get(1))
         #output->append('/">')
         #output->append($reservations->find(#curRes)->get(2))
         #output->append('</a></td>')
     case // default does not need a test for false.  if it's
not true, then it must be false.
         ...etc...
}
#output

--steve


On 1/21/15 at 10:45 AM, [hidden email] (Marc
Pinnell) pronounced:

>Maybe I have been looking at this too long... The code below is generating this error:
>
>Lasso Error Code: -9948
>Error Description: Definition Not Found: string->invoke(string)
>Candidates were: null->invoke()
>Error Stack: 301:64 //.../admin-reservations-home.lasso
>
>
>local(
>curRes = #quadTime->get(loop_count),
>rowsc = $reservations->find(#curRes)->get(4),
>colsc = $reservations->find(#curRes)->get(5)
>)
>
>match($reservations->find(#curRes)->get(3)) => {^
>case(TRUE)
>'<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' +
>#rowsc + '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>href="/admin/edit+reservation/' +
>$reservations->find(#curRes)->get(1) + '/">' +
>$reservations->find(#curRes)->get(2) + '</a></td>'
>case(FALSE)
>'<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' +
>#rowsc + '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>href="/admin/edit+reservation/' +
>$reservations->find(#curRes)->get(1) + '/">' +
>$reservations->find(#curRes)->get(2) + '</a></td>'
>^}
>
>
>* Line 301 is the "td" line under TRUE, position 64 would be
>the second occurrence of "#rowsc" in that line.
>* #rowsc is an integer (verified)
>* Removing #rowsc shifts the error forward to the second
>occurrence of #colsc, which is also an integer
>* Changing #rowsc to #rowsc->asString (in the second occurrence) changes nothing
>
>Help! Probably something stupid easy, but I have been staring at it too long.
>
>Marc Pinnell
>1027 Design
>PO Box 990872
>Redding, CA 96099-0872
>530.941.4706
>fax: 866.232.5300
>www.1027Design.com
>
>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Marc Pinnell-3
In reply to this post by Brad Lindsay
Swear I tried that, but guess what, yep that was it!!

Thanks you two!

Marc


On Jan 21, 2015, at 12:08 PM, Brad Lindsay <[hidden email]> wrote:

> Definitely missing a + sign between the two ternaries.
>
> Brad
>
> On January 21, 2015 at 2:36:14 PM, Jolle Carlestam ([hidden email]) wrote:
>> This would be the culprit. Are you missing a + sign?
>>
>> HDB
>> Jolle
>>
>> Sent from a mobile device. Any anomalies is due to Autocorrect.
>>
>>> 21 jan 2015 kl. 19:45 skrev Marc Pinnell :
>>>
>>> '"')(#colsc
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to:
>> Send administrative queries to
>>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Marc Pinnell-3
In reply to this post by stevepiercy
Yeah, crappy coding. I would normally do it the way you suggested, but one of those things that just took on a life of it's own. Need to stop and take a deep breath once in a while and look at what I am doing.

On the MATCH statement.. you are correct. Was originally going to be more than two values and grew into a BOOLEAN situation. That whole section, now that it works, needs some cleanup.

Marc


On Jan 21, 2015, at 12:58 PM, Steve Piercy - Website Builder <[hidden email]> wrote:

> When you can't read your own code, it's a sign that you should modify it.  Additionally, it will identify on precisely which line you have a syntax error.  A long single line of string concatenation makes it harder to find the error.
>
> local(output) = string
> match($reservations->find(#curRes)->get(3)) => {
>    case(true)
>        #output->append('<td class="reserved success"')
>        #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
>        #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
>        #output->append('><a href="/admin/edit+reservation/')
>        #output->append($reservations->find(#curRes)->get(1))
>        #output->append('/">')
>        #output->append($reservations->find(#curRes)->get(2))
>        #output->append('</a></td>')
>    case // default does not need a test for false.  if it's not true, then it must be false.
>        ...etc...
> }
> #output
>
> --steve
>
>
> On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell) pronounced:
>
>> Maybe I have been looking at this too long... The code below is generating this error:
>>
>> Lasso Error Code: -9948
>> Error Description: Definition Not Found: string->invoke(string) Candidates were: null->invoke()
>> Error Stack: 301:64 //.../admin-reservations-home.lasso
>>
>>
>> local(
>> curRes = #quadTime->get(loop_count),
>> rowsc = $reservations->find(#curRes)->get(4),
>> colsc = $reservations->find(#curRes)->get(5)
>> )
>>
>> match($reservations->find(#curRes)->get(3)) => {^
>> case(TRUE)
>> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc + '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) + '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>> case(FALSE)
>> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc + '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) + '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>> ^}
>>
>>
>> * Line 301 is the "td" line under TRUE, position 64 would be the second occurrence of "#rowsc" in that line.
>> * #rowsc is an integer (verified)
>> * Removing #rowsc shifts the error forward to the second occurrence of #colsc, which is also an integer
>> * Changing #rowsc to #rowsc->asString (in the second occurrence) changes nothing
>>
>> Help! Probably something stupid easy, but I have been staring at it too long.
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Bil Corry-3
In reply to this post by stevepiercy
Since we're offering up alternative suggestions for coding, here's another
way:


local(curRes) = #quadTime->get(loop_count);
local(res) = $reservations->find(#curRes);
local(resURL) = #res->get(1);
local(resURLName) = #res->get(2);
local(resSuccess) = boolean(#res->get(3));
local(rowsc) = integer(#res->get(4));
local(colsc) = integer(#res->get(5));

 '<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
(#rowsc != 0 ? ' rowspan="' + #rowsc + '"') + (#colsc > 0 ? ' colspan="' +
#colsc + '"') + '><a href="/admin/edit+reservation/' + #resURL + '/">' +
#resURLName + '</a></td>';


- Bil


On Wed, Jan 21, 2015 at 9:58 PM, Steve Piercy - Website Builder <
[hidden email]> wrote:

> When you can't read your own code, it's a sign that you should modify it.
> Additionally, it will identify on precisely which line you have a syntax
> error.  A long single line of string concatenation makes it harder to find
> the error.
>
> local(output) = string
> match($reservations->find(#curRes)->get(3)) => {
>     case(true)
>         #output->append('<td class="reserved success"')
>         #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
>         #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
>         #output->append('><a href="/admin/edit+reservation/')
>         #output->append($reservations->find(#curRes)->get(1))
>         #output->append('/">')
>         #output->append($reservations->find(#curRes)->get(2))
>         #output->append('</a></td>')
>     case // default does not need a test for false.  if it's not true,
> then it must be false.
>         ...etc...
> }
> #output
>
> --steve
>
>
> On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell)
> pronounced:
>
>
>  Maybe I have been looking at this too long... The code below is
>> generating this error:
>>
>> Lasso Error Code: -9948
>> Error Description: Definition Not Found: string->invoke(string)
>> Candidates were: null->invoke()
>> Error Stack: 301:64 //.../admin-reservations-home.lasso
>>
>>
>> local(
>> curRes = #quadTime->get(loop_count),
>> rowsc = $reservations->find(#curRes)->get(4),
>> colsc = $reservations->find(#curRes)->get(5)
>> )
>>
>> match($reservations->find(#curRes)->get(3)) => {^
>> case(TRUE)
>> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc +
>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>> case(FALSE)
>> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc +
>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>> ^}
>>
>>
>> * Line 301 is the "td" line under TRUE, position 64 would be the second
>> occurrence of "#rowsc" in that line.
>> * #rowsc is an integer (verified)
>> * Removing #rowsc shifts the error forward to the second occurrence of
>> #colsc, which is also an integer
>> * Changing #rowsc to #rowsc->asString (in the second occurrence) changes
>> nothing
>>
>> Help! Probably something stupid easy, but I have been staring at it too
>> long.
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Marc Pinnell-3
While I can see the benefits of what both you and Steve offered, does it cause extra overhead (memory, speed, etc) that should be a concern with adding all these extra locals? Or is it insignificant enough that the benefits of readability outweigh the extra load?

Marc


On Jan 22, 2015, at 6:15 AM, Bil Corry <[hidden email]> wrote:

> Since we're offering up alternative suggestions for coding, here's another
> way:
>
>
> local(curRes) = #quadTime->get(loop_count);
> local(res) = $reservations->find(#curRes);
> local(resURL) = #res->get(1);
> local(resURLName) = #res->get(2);
> local(resSuccess) = boolean(#res->get(3));
> local(rowsc) = integer(#res->get(4));
> local(colsc) = integer(#res->get(5));
>
> '<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
> (#rowsc != 0 ? ' rowspan="' + #rowsc + '"') + (#colsc > 0 ? ' colspan="' +
> #colsc + '"') + '><a href="/admin/edit+reservation/' + #resURL + '/">' +
> #resURLName + '</a></td>';
>
>
> - Bil
>
>
> On Wed, Jan 21, 2015 at 9:58 PM, Steve Piercy - Website Builder <
> [hidden email]> wrote:
>
>> When you can't read your own code, it's a sign that you should modify it.
>> Additionally, it will identify on precisely which line you have a syntax
>> error.  A long single line of string concatenation makes it harder to find
>> the error.
>>
>> local(output) = string
>> match($reservations->find(#curRes)->get(3)) => {
>>    case(true)
>>        #output->append('<td class="reserved success"')
>>        #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
>>        #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
>>        #output->append('><a href="/admin/edit+reservation/')
>>        #output->append($reservations->find(#curRes)->get(1))
>>        #output->append('/">')
>>        #output->append($reservations->find(#curRes)->get(2))
>>        #output->append('</a></td>')
>>    case // default does not need a test for false.  if it's not true,
>> then it must be false.
>>        ...etc...
>> }
>> #output
>>
>> --steve
>>
>>
>> On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell)
>> pronounced:
>>
>>
>> Maybe I have been looking at this too long... The code below is
>>> generating this error:
>>>
>>> Lasso Error Code: -9948
>>> Error Description: Definition Not Found: string->invoke(string)
>>> Candidates were: null->invoke()
>>> Error Stack: 301:64 //.../admin-reservations-home.lasso
>>>
>>>
>>> local(
>>> curRes = #quadTime->get(loop_count),
>>> rowsc = $reservations->find(#curRes)->get(4),
>>> colsc = $reservations->find(#curRes)->get(5)
>>> )
>>>
>>> match($reservations->find(#curRes)->get(3)) => {^
>>> case(TRUE)
>>> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc +
>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>> case(FALSE)
>>> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc +
>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>> ^}
>>>
>>>
>>> * Line 301 is the "td" line under TRUE, position 64 would be the second
>>> occurrence of "#rowsc" in that line.
>>> * #rowsc is an integer (verified)
>>> * Removing #rowsc shifts the error forward to the second occurrence of
>>> #colsc, which is also an integer
>>> * Changing #rowsc to #rowsc->asString (in the second occurrence) changes
>>> nothing
>>>
>>> Help! Probably something stupid easy, but I have been staring at it too
>>> long.
>>>
>>> Marc Pinnell
>>> 1027 Design
>>> PO Box 990872
>>> Redding, CA 96099-0872
>>> 530.941.4706
>>> fax: 866.232.5300
>>> www.1027Design.com
>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy              Website Builder              Soquel, CA
>> <[hidden email]>               <http://www.StevePiercy.com/>
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

stevepiercy
Who knows?  That's why you're always testing your own code for performance, riiiiiight?  ;)

--steve


On 1/22/15 at 10:39 AM, [hidden email] (Marc Pinnell) pronounced:

> While I can see the benefits of what both you and Steve offered, does it cause extra
> overhead (memory, speed, etc) that should be a concern with adding all these extra
> locals? Or is it insignificant enough that the benefits of readability outweigh the
> extra load?
>
> Marc
>
>
> On Jan 22, 2015, at 6:15 AM, Bil Corry <[hidden email]> wrote:
>
> > Since we're offering up alternative suggestions for coding, here's another
> > way:
> >
> >
> > local(curRes) = #quadTime->get(loop_count);
> > local(res) = $reservations->find(#curRes);
> > local(resURL) = #res->get(1);
> > local(resURLName) = #res->get(2);
> > local(resSuccess) = boolean(#res->get(3));
> > local(rowsc) = integer(#res->get(4));
> > local(colsc) = integer(#res->get(5));
> >
> > '<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
> > (#rowsc != 0 ? ' rowspan="' + #rowsc + '"') + (#colsc > 0 ? ' colspan="' +
> > #colsc + '"') + '><a href="/admin/edit+reservation/' + #resURL + '/">' +
> > #resURLName + '</a></td>';
> >
> >
> > - Bil
> >
> >
> > On Wed, Jan 21, 2015 at 9:58 PM, Steve Piercy - Website Builder <
> > [hidden email]> wrote:
> >
> >> When you can't read your own code, it's a sign that you should modify it.
> >> Additionally, it will identify on precisely which line you have a syntax
> >> error.  A long single line of string concatenation makes it harder to find
> >> the error.
> >>
> >> local(output) = string
> >> match($reservations->find(#curRes)->get(3)) => {
> >>    case(true)
> >>        #output->append('<td class="reserved success"')
> >>        #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
> >>        #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
> >>        #output->append('><a href="/admin/edit+reservation/')
> >>        #output->append($reservations->find(#curRes)->get(1))
> >>        #output->append('/">')
> >>        #output->append($reservations->find(#curRes)->get(2))
> >>        #output->append('</a></td>')
> >>    case // default does not need a test for false.  if it's not true,
> >> then it must be false.
> >>        ...etc...
> >> }
> >> #output
> >>
> >> --steve
> >>
> >>
> >> On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell)
> >> pronounced:
> >>
> >>
> >> Maybe I have been looking at this too long... The code below is
> >>> generating this error:
> >>>
> >>> Lasso Error Code: -9948
> >>> Error Description: Definition Not Found: string->invoke(string)
> >>> Candidates were: null->invoke()
> >>> Error Stack: 301:64 //.../admin-reservations-home.lasso
> >>>
> >>>
> >>> local(
> >>> curRes = #quadTime->get(loop_count),
> >>> rowsc = $reservations->find(#curRes)->get(4),
> >>> colsc = $reservations->find(#curRes)->get(5)
> >>> )
> >>>
> >>> match($reservations->find(#curRes)->get(3)) => {^
> >>> case(TRUE)
> >>> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc +
> >>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
> >>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
> >>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
> >>> case(FALSE)
> >>> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc +
> >>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
> >>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
> >>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
> >>> ^}
> >>>
> >>>
> >>> * Line 301 is the "td" line under TRUE, position 64 would be the second
> >>> occurrence of "#rowsc" in that line.
> >>> * #rowsc is an integer (verified)
> >>> * Removing #rowsc shifts the error forward to the second occurrence of
> >>> #colsc, which is also an integer
> >>> * Changing #rowsc to #rowsc->asString (in the second occurrence) changes
> >>> nothing
> >>>
> >>> Help! Probably something stupid easy, but I have been staring at it too
> >>> long.
> >>>
> >>> Marc Pinnell
> >>> 1027 Design
> >>> PO Box 990872
> >>> Redding, CA 96099-0872
> >>> 530.941.4706
> >>> fax: 866.232.5300
> >>> www.1027Design.com
> >>>
> >>>
> >>>
> >>> #############################################################
> >>>
> >>> This message is sent to you because you are subscribed to
> >>> the mailing list Lasso [hidden email]
> >>> Official list archives available at http://www.lassotalk.com
> >>> To unsubscribe, E-mail to: <[hidden email]>
> >>> Send administrative queries to  <[hidden email]>
> >>>
> >>
> >> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >> Steve Piercy              Website Builder              Soquel, CA
> >> <[hidden email]>               <http://www.StevePiercy.com/>
> >>
> >>
> >>
> >> #############################################################
> >>
> >> This message is sent to you because you are subscribed to
> >> the mailing list Lasso [hidden email]
> >> Official list archives available at http://www.lassotalk.com
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >>
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Marc Pinnell-3
Oh, of course!

marc


On Jan 22, 2015, at 12:36 PM, Steve Piercy - Website Builder <[hidden email]> wrote:

> Who knows?  That's why you're always testing your own code for performance, riiiiiight?  ;)
>
> --steve
>
>
> On 1/22/15 at 10:39 AM, [hidden email] (Marc Pinnell) pronounced:
>
>> While I can see the benefits of what both you and Steve offered, does it cause extra
>> overhead (memory, speed, etc) that should be a concern with adding all these extra
>> locals? Or is it insignificant enough that the benefits of readability outweigh the
>> extra load?
>>
>> Marc
>>
>>
>> On Jan 22, 2015, at 6:15 AM, Bil Corry <[hidden email]> wrote:
>>
>>> Since we're offering up alternative suggestions for coding, here's another
>>> way:
>>>
>>>
>>> local(curRes) = #quadTime->get(loop_count);
>>> local(res) = $reservations->find(#curRes);
>>> local(resURL) = #res->get(1);
>>> local(resURLName) = #res->get(2);
>>> local(resSuccess) = boolean(#res->get(3));
>>> local(rowsc) = integer(#res->get(4));
>>> local(colsc) = integer(#res->get(5));
>>>
>>> '<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
>>> (#rowsc != 0 ? ' rowspan="' + #rowsc + '"') + (#colsc > 0 ? ' colspan="' +
>>> #colsc + '"') + '><a href="/admin/edit+reservation/' + #resURL + '/">' +
>>> #resURLName + '</a></td>';
>>>
>>>
>>> - Bil
>>>
>>>
>>> On Wed, Jan 21, 2015 at 9:58 PM, Steve Piercy - Website Builder <
>>> [hidden email]> wrote:
>>>
>>>> When you can't read your own code, it's a sign that you should modify it.
>>>> Additionally, it will identify on precisely which line you have a syntax
>>>> error.  A long single line of string concatenation makes it harder to find
>>>> the error.
>>>>
>>>> local(output) = string
>>>> match($reservations->find(#curRes)->get(3)) => {
>>>>   case(true)
>>>>       #output->append('<td class="reserved success"')
>>>>       #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
>>>>       #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
>>>>       #output->append('><a href="/admin/edit+reservation/')
>>>>       #output->append($reservations->find(#curRes)->get(1))
>>>>       #output->append('/">')
>>>>       #output->append($reservations->find(#curRes)->get(2))
>>>>       #output->append('</a></td>')
>>>>   case // default does not need a test for false.  if it's not true,
>>>> then it must be false.
>>>>       ...etc...
>>>> }
>>>> #output
>>>>
>>>> --steve
>>>>
>>>>
>>>> On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell)
>>>> pronounced:
>>>>
>>>>
>>>> Maybe I have been looking at this too long... The code below is
>>>>> generating this error:
>>>>>
>>>>> Lasso Error Code: -9948
>>>>> Error Description: Definition Not Found: string->invoke(string)
>>>>> Candidates were: null->invoke()
>>>>> Error Stack: 301:64 //.../admin-reservations-home.lasso
>>>>>
>>>>>
>>>>> local(
>>>>> curRes = #quadTime->get(loop_count),
>>>>> rowsc = $reservations->find(#curRes)->get(4),
>>>>> colsc = $reservations->find(#curRes)->get(5)
>>>>> )
>>>>>
>>>>> match($reservations->find(#curRes)->get(3)) => {^
>>>>> case(TRUE)
>>>>> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc +
>>>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
>>>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>>>> case(FALSE)
>>>>> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc +
>>>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
>>>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>>>> ^}
>>>>>
>>>>>
>>>>> * Line 301 is the "td" line under TRUE, position 64 would be the second
>>>>> occurrence of "#rowsc" in that line.
>>>>> * #rowsc is an integer (verified)
>>>>> * Removing #rowsc shifts the error forward to the second occurrence of
>>>>> #colsc, which is also an integer
>>>>> * Changing #rowsc to #rowsc->asString (in the second occurrence) changes
>>>>> nothing
>>>>>
>>>>> Help! Probably something stupid easy, but I have been staring at it too
>>>>> long.
>>>>>
>>>>> Marc Pinnell
>>>>> 1027 Design
>>>>> PO Box 990872
>>>>> Redding, CA 96099-0872
>>>>> 530.941.4706
>>>>> fax: 866.232.5300
>>>>> www.1027Design.com
>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy              Website Builder              Soquel, CA
>>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> Marc Pinnell
>> 1027 Design
>> PO Box 990872
>> Redding, CA 96099-0872
>> 530.941.4706
>> fax: 866.232.5300
>> www.1027Design.com
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Bil Corry-3
In reply to this post by Marc Pinnell-3
For every local that is only used once on the page, you can omit the local
and substitute the code that created the local (e.g. #res->get(1) instead
of #resURL).  That will be faster and use less memory, but it may be harder
to read/debug.

For the locals where they're used multiple times, especially when you're
doing an operation, it's faster if you create/use a local instead.  So
rather than looking up the same map value 10 times, look it up once, put it
into a local, then use the local 10 times.

All of that said, unless you have a high load website, chances are you can
do whatever you want and still have decent performance.  That's why I go
for readability, which saves me time down the road when I need to revisit
the code.  I can scale my server up by buying a bigger/faster server, but I
can't scale myself up.


- Bil


On Thu, Jan 22, 2015 at 7:39 PM, Marc Pinnell <[hidden email]>
wrote:

> While I can see the benefits of what both you and Steve offered, does it
> cause extra overhead (memory, speed, etc) that should be a concern with
> adding all these extra locals? Or is it insignificant enough that the
> benefits of readability outweigh the extra load?
>
> Marc
>
>
> On Jan 22, 2015, at 6:15 AM, Bil Corry <[hidden email]> wrote:
>
> > Since we're offering up alternative suggestions for coding, here's
> another
> > way:
> >
> >
> > local(curRes) = #quadTime->get(loop_count);
> > local(res) = $reservations->find(#curRes);
> > local(resURL) = #res->get(1);
> > local(resURLName) = #res->get(2);
> > local(resSuccess) = boolean(#res->get(3));
> > local(rowsc) = integer(#res->get(4));
> > local(colsc) = integer(#res->get(5));
> >
> > '<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
> > (#rowsc != 0 ? ' rowspan="' + #rowsc + '"') + (#colsc > 0 ? ' colspan="'
> +
> > #colsc + '"') + '><a href="/admin/edit+reservation/' + #resURL + '/">' +
> > #resURLName + '</a></td>';
> >
> >
> > - Bil
> >
> >
> > On Wed, Jan 21, 2015 at 9:58 PM, Steve Piercy - Website Builder <
> > [hidden email]> wrote:
> >
> >> When you can't read your own code, it's a sign that you should modify
> it.
> >> Additionally, it will identify on precisely which line you have a syntax
> >> error.  A long single line of string concatenation makes it harder to
> find
> >> the error.
> >>
> >> local(output) = string
> >> match($reservations->find(#curRes)->get(3)) => {
> >>    case(true)
> >>        #output->append('<td class="reserved success"')
> >>        #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
> >>        #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
> >>        #output->append('><a href="/admin/edit+reservation/')
> >>        #output->append($reservations->find(#curRes)->get(1))
> >>        #output->append('/">')
> >>        #output->append($reservations->find(#curRes)->get(2))
> >>        #output->append('</a></td>')
> >>    case // default does not need a test for false.  if it's not true,
> >> then it must be false.
> >>        ...etc...
> >> }
> >> #output
> >>
> >> --steve
> >>
> >>
> >> On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell)
> >> pronounced:
> >>
> >>
> >> Maybe I have been looking at this too long... The code below is
> >>> generating this error:
> >>>
> >>> Lasso Error Code: -9948
> >>> Error Description: Definition Not Found: string->invoke(string)
> >>> Candidates were: null->invoke()
> >>> Error Stack: 301:64 //.../admin-reservations-home.lasso
> >>>
> >>>
> >>> local(
> >>> curRes = #quadTime->get(loop_count),
> >>> rowsc = $reservations->find(#curRes)->get(4),
> >>> colsc = $reservations->find(#curRes)->get(5)
> >>> )
> >>>
> >>> match($reservations->find(#curRes)->get(3)) => {^
> >>> case(TRUE)
> >>> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc +
> >>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
> >>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1)
> +
> >>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
> >>> case(FALSE)
> >>> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc +
> >>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
> >>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1)
> +
> >>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
> >>> ^}
> >>>
> >>>
> >>> * Line 301 is the "td" line under TRUE, position 64 would be the second
> >>> occurrence of "#rowsc" in that line.
> >>> * #rowsc is an integer (verified)
> >>> * Removing #rowsc shifts the error forward to the second occurrence of
> >>> #colsc, which is also an integer
> >>> * Changing #rowsc to #rowsc->asString (in the second occurrence)
> changes
> >>> nothing
> >>>
> >>> Help! Probably something stupid easy, but I have been staring at it too
> >>> long.
> >>>
> >>> Marc Pinnell
> >>> 1027 Design
> >>> PO Box 990872
> >>> Redding, CA 96099-0872
> >>> 530.941.4706
> >>> fax: 866.232.5300
> >>> www.1027Design.com
> >>>
> >>>
> >>>
> >>> #############################################################
> >>>
> >>> This message is sent to you because you are subscribed to
> >>> the mailing list Lasso [hidden email]
> >>> Official list archives available at http://www.lassotalk.com
> >>> To unsubscribe, E-mail to: <[hidden email]>
> >>> Send administrative queries to  <[hidden email]>
> >>>
> >>
> >> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >> Steve Piercy              Website Builder              Soquel, CA
> >> <[hidden email]>               <http://www.StevePiercy.com/>
> >>
> >>
> >>
> >> #############################################################
> >>
> >> This message is sent to you because you are subscribed to
> >> the mailing list Lasso [hidden email]
> >> Official list archives available at http://www.lassotalk.com
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >>
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
> Marc Pinnell
> 1027 Design
> PO Box 990872
> Redding, CA 96099-0872
> 530.941.4706
> fax: 866.232.5300
> www.1027Design.com
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

stevepiercy
Your future self will appreciate it.  Readability counts.
http://www.thezenofpython.com/

Also it is easy to get mired in the minutiae of performance when
a general understanding of it is sufficient and can be balanced
with the benefit of writing readable code.  For many web
applications, scaling will never be a concern.  When it does
become a concern, then you'll probably be making bank on it and
can afford to make the necessary changes to improve performance.

--steve


On 1/22/15 at 11:19 PM, [hidden email] (Bil Corry) pronounced:

>For every local that is only used once on the page, you can omit the local
>and substitute the code that created the local (e.g. #res->get(1) instead
>of #resURL).  That will be faster and use less memory, but it may be harder
>to read/debug.
>
>For the locals where they're used multiple times, especially when you're
>doing an operation, it's faster if you create/use a local instead.  So
>rather than looking up the same map value 10 times, look it up once, put it
>into a local, then use the local 10 times.
>
>All of that said, unless you have a high load website, chances are you can
>do whatever you want and still have decent performance.  That's why I go
>for readability, which saves me time down the road when I need to revisit
>the code.  I can scale my server up by buying a bigger/faster server, but I
>can't scale myself up.
>
>
>- Bil
>
>
>On Thu, Jan 22, 2015 at 7:39 PM, Marc Pinnell <[hidden email]>
>wrote:
>
>>While I can see the benefits of what both you and Steve offered, does it
>>cause extra overhead (memory, speed, etc) that should be a concern with
>>adding all these extra locals? Or is it insignificant enough that the
>>benefits of readability outweigh the extra load?
>>
>>Marc
>>
>>
>>On Jan 22, 2015, at 6:15 AM, Bil Corry <[hidden email]> wrote:
>>
>>>Since we're offering up alternative suggestions for coding, here's
>>another
>>>way:
>>>
>>>
>>>local(curRes) = #quadTime->get(loop_count);
>>>local(res) = $reservations->find(#curRes);
>>>local(resURL) = #res->get(1);
>>>local(resURLName) = #res->get(2);
>>>local(resSuccess) = boolean(#res->get(3));
>>>local(rowsc) = integer(#res->get(4));
>>>local(colsc) = integer(#res->get(5));
>>>
>>>'<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
>>>(#rowsc != 0 ? ' rowspan="' + #rowsc + '"') + (#colsc > 0 ? ' colspan="'
>>+
>>>#colsc + '"') + '><a href="/admin/edit+reservation/' + #resURL + '/">' +
>>>#resURLName + '</a></td>';
>>>
>>>
>>>- Bil
>>>
>>>
>>>On Wed, Jan 21, 2015 at 9:58 PM, Steve Piercy - Website Builder <
>>>[hidden email]> wrote:
>>>
>>>> When you can't read your own code, it's a sign that you should modify
>>it.
>>>> Additionally, it will identify on precisely which line you have a syntax
>>>> error.  A long single line of string concatenation makes it harder to
>>find
>>>> the error.
>>>>
>>>> local(output) = string
>>>> match($reservations->find(#curRes)->get(3)) => {
>>>>    case(true)
>>>>        #output->append('<td class="reserved success"')
>>>>        #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
>>>>        #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
>>>>        #output->append('><a href="/admin/edit+reservation/')
>>>>        #output->append($reservations->find(#curRes)->get(1))
>>>>        #output->append('/">')
>>>>        #output->append($reservations->find(#curRes)->get(2))
>>>>        #output->append('</a></td>')
>>>>    case // default does not need a test for false.  if it's not true,
>>>> then it must be false.
>>>>        ...etc...
>>>> }
>>>> #output
>>>>
>>>> --steve
>>>>
>>>>
>>>> On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell)
>>>> pronounced:
>>>>
>>>>
>>>> Maybe I have been looking at this too long... The code below is
>>>>> generating this error:
>>>>>
>>>>> Lasso Error Code: -9948
>>>>> Error Description: Definition Not Found: string->invoke(string)
>>>>> Candidates were: null->invoke()
>>>>> Error Stack: 301:64 //.../admin-reservations-home.lasso
>>>>>
>>>>>
>>>>> local(
>>>>> curRes = #quadTime->get(loop_count),
>>>>> rowsc = $reservations->find(#curRes)->get(4),
>>>>> colsc = $reservations->find(#curRes)->get(5)
>>>>> )
>>>>>
>>>>> match($reservations->find(#curRes)->get(3)) => {^
>>>>> case(TRUE)
>>>>> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc +
>>>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1)
>>+
>>>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>>>> case(FALSE)
>>>>> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc +
>>>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1)
>>+
>>>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>>>> ^}
>>>>>
>>>>>
>>>>> * Line 301 is the "td" line under TRUE, position 64 would be the second
>>>>> occurrence of "#rowsc" in that line.
>>>>> * #rowsc is an integer (verified)
>>>>> * Removing #rowsc shifts the error forward to the second occurrence of
>>>>> #colsc, which is also an integer
>>>>> * Changing #rowsc to #rowsc->asString (in the second occurrence)
>>changes
>>>>> nothing
>>>>>
>>>>> Help! Probably something stupid easy, but I have been staring at it too
>>>>> long.
>>>>>
>>>>> Marc Pinnell
>>>>> 1027 Design
>>>>> PO Box 990872
>>>>> Redding, CA 96099-0872
>>>>> 530.941.4706
>>>>> fax: 866.232.5300
>>>>> www.1027Design.com
>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy              Website Builder              Soquel, CA
>>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>>#############################################################
>>>
>>>This message is sent to you because you are subscribed to
>>>the mailing list Lasso [hidden email]
>>>Official list archives available at http://www.lassotalk.com
>>>To unsubscribe, E-mail to: <[hidden email]>
>>>Send administrative queries to  <[hidden email]>
>>
>>Marc Pinnell
>>1027 Design
>>PO Box 990872
>>Redding, CA 96099-0872
>>530.941.4706
>>fax: 866.232.5300
>>www.1027Design.com
>>
>>
>>
>>#############################################################
>>
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso [hidden email]
>>Official list archives available at http://www.lassotalk.com
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Marc Pinnell-3
I'd have to agree with that!


On Jan 22, 2015, at 2:40 PM, Steve Piercy - Website Builder <[hidden email]> wrote:

> Your future self will appreciate it.  Readability counts.
> http://www.thezenofpython.com/
>
> Also it is easy to get mired in the minutiae of performance when a general understanding of it is sufficient and can be balanced with the benefit of writing readable code.  For many web applications, scaling will never be a concern.  When it does become a concern, then you'll probably be making bank on it and can afford to make the necessary changes to improve performance.
>
> --steve
>
>
> On 1/22/15 at 11:19 PM, [hidden email] (Bil Corry) pronounced:
>
>> For every local that is only used once on the page, you can omit the local
>> and substitute the code that created the local (e.g. #res->get(1) instead
>> of #resURL).  That will be faster and use less memory, but it may be harder
>> to read/debug.
>>
>> For the locals where they're used multiple times, especially when you're
>> doing an operation, it's faster if you create/use a local instead.  So
>> rather than looking up the same map value 10 times, look it up once, put it
>> into a local, then use the local 10 times.
>>
>> All of that said, unless you have a high load website, chances are you can
>> do whatever you want and still have decent performance.  That's why I go
>> for readability, which saves me time down the road when I need to revisit
>> the code.  I can scale my server up by buying a bigger/faster server, but I
>> can't scale myself up.
>>
>>
>> - Bil
>>
>>
>> On Thu, Jan 22, 2015 at 7:39 PM, Marc Pinnell <[hidden email]>
>> wrote:
>>
>>> While I can see the benefits of what both you and Steve offered, does it
>>> cause extra overhead (memory, speed, etc) that should be a concern with
>>> adding all these extra locals? Or is it insignificant enough that the
>>> benefits of readability outweigh the extra load?
>>>
>>> Marc
>>>
>>>
>>> On Jan 22, 2015, at 6:15 AM, Bil Corry <[hidden email]> wrote:
>>>
>>>> Since we're offering up alternative suggestions for coding, here's
>>> another
>>>> way:
>>>>
>>>>
>>>> local(curRes) = #quadTime->get(loop_count);
>>>> local(res) = $reservations->find(#curRes);
>>>> local(resURL) = #res->get(1);
>>>> local(resURLName) = #res->get(2);
>>>> local(resSuccess) = boolean(#res->get(3));
>>>> local(rowsc) = integer(#res->get(4));
>>>> local(colsc) = integer(#res->get(5));
>>>>
>>>> '<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
>>>> (#rowsc != 0 ? ' rowspan="' + #rowsc + '"') + (#colsc > 0 ? ' colspan="'
>>> +
>>>> #colsc + '"') + '><a href="/admin/edit+reservation/' + #resURL + '/">' +
>>>> #resURLName + '</a></td>';
>>>>
>>>>
>>>> - Bil
>>>>
>>>>
>>>> On Wed, Jan 21, 2015 at 9:58 PM, Steve Piercy - Website Builder <
>>>> [hidden email]> wrote:
>>>>
>>>>> When you can't read your own code, it's a sign that you should modify
>>> it.
>>>>> Additionally, it will identify on precisely which line you have a syntax
>>>>> error.  A long single line of string concatenation makes it harder to
>>> find
>>>>> the error.
>>>>>
>>>>> local(output) = string
>>>>> match($reservations->find(#curRes)->get(3)) => {
>>>>>   case(true)
>>>>>       #output->append('<td class="reserved success"')
>>>>>       #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
>>>>>       #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
>>>>>       #output->append('><a href="/admin/edit+reservation/')
>>>>>       #output->append($reservations->find(#curRes)->get(1))
>>>>>       #output->append('/">')
>>>>>       #output->append($reservations->find(#curRes)->get(2))
>>>>>       #output->append('</a></td>')
>>>>>   case // default does not need a test for false.  if it's not true,
>>>>> then it must be false.
>>>>>       ...etc...
>>>>> }
>>>>> #output
>>>>>
>>>>> --steve
>>>>>
>>>>>
>>>>> On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell)
>>>>> pronounced:
>>>>>
>>>>>
>>>>> Maybe I have been looking at this too long... The code below is
>>>>>> generating this error:
>>>>>>
>>>>>> Lasso Error Code: -9948
>>>>>> Error Description: Definition Not Found: string->invoke(string)
>>>>>> Candidates were: null->invoke()
>>>>>> Error Stack: 301:64 //.../admin-reservations-home.lasso
>>>>>>
>>>>>>
>>>>>> local(
>>>>>> curRes = #quadTime->get(loop_count),
>>>>>> rowsc = $reservations->find(#curRes)->get(4),
>>>>>> colsc = $reservations->find(#curRes)->get(5)
>>>>>> )
>>>>>>
>>>>>> match($reservations->find(#curRes)->get(3)) => {^
>>>>>> case(TRUE)
>>>>>> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc +
>>>>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>>>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1)
>>> +
>>>>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>>>>> case(FALSE)
>>>>>> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc +
>>>>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>>>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1)
>>> +
>>>>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>>>>> ^}
>>>>>>
>>>>>>
>>>>>> * Line 301 is the "td" line under TRUE, position 64 would be the second
>>>>>> occurrence of "#rowsc" in that line.
>>>>>> * #rowsc is an integer (verified)
>>>>>> * Removing #rowsc shifts the error forward to the second occurrence of
>>>>>> #colsc, which is also an integer
>>>>>> * Changing #rowsc to #rowsc->asString (in the second occurrence)
>>> changes
>>>>>> nothing
>>>>>>
>>>>>> Help! Probably something stupid easy, but I have been staring at it too
>>>>>> long.
>>>>>>
>>>>>> Marc Pinnell
>>>>>> 1027 Design
>>>>>> PO Box 990872
>>>>>> Redding, CA 96099-0872
>>>>>> 530.941.4706
>>>>>> fax: 866.232.5300
>>>>>> www.1027Design.com
>>>>>>
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>>
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>
>>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>> Steve Piercy              Website Builder              Soquel, CA
>>>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> Marc Pinnell
>>> 1027 Design
>>> PO Box 990872
>>> Redding, CA 96099-0872
>>> 530.941.4706
>>> fax: 866.232.5300
>>> www.1027Design.com
>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Soquel, CA
> <[hidden email]>               <http://www.StevePiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Ke Carlton-3
In reply to this post by Bil Corry-3
I would take it a step further:

local(
curRes     = #quadTime->get(loop_count),
res        = $reservations->find(#curRes),
resURL     = #res->get(1),
resURLName = #res->get(2),
resSuccess = boolean(#res->get(3)),
rowsc      = integer(#res->get(4)),
colsc      = integer(#res->get(5))
)

'<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
(#rowsc != 0 ? ' rowspan="' + #rowsc + '"') +
(#colsc > 0 ? ' colspan="' + #colsc + '"') + '>' +
'<a href="/admin/edit+reservation/' + #resURL + '/">' + #resURLName +
'</a>' +
'</td>'

Compacting the locals down to one local declaration and perhaps more
importantly retaining readability of the html / string by using making the
most of the trailing +'s...


On 23 January 2015 at 03:15, Bil Corry <[hidden email]> wrote:

> Since we're offering up alternative suggestions for coding, here's another
> way:
>
>
> local(curRes) = #quadTime->get(loop_count);
> local(res) = $reservations->find(#curRes);
> local(resURL) = #res->get(1);
> local(resURLName) = #res->get(2);
> local(resSuccess) = boolean(#res->get(3));
> local(rowsc) = integer(#res->get(4));
> local(colsc) = integer(#res->get(5));
>
>  '<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
> (#rowsc != 0 ? ' rowspan="' + #rowsc + '"') + (#colsc > 0 ? ' colspan="' +
> #colsc + '"') + '><a href="/admin/edit+reservation/' + #resURL + '/">' +
> #resURLName + '</a></td>';
>
>
> - Bil
>
>
> On Wed, Jan 21, 2015 at 9:58 PM, Steve Piercy - Website Builder <
> [hidden email]> wrote:
>
> > When you can't read your own code, it's a sign that you should modify it.
> > Additionally, it will identify on precisely which line you have a syntax
> > error.  A long single line of string concatenation makes it harder to
> find
> > the error.
> >
> > local(output) = string
> > match($reservations->find(#curRes)->get(3)) => {
> >     case(true)
> >         #output->append('<td class="reserved success"')
> >         #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
> >         #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
> >         #output->append('><a href="/admin/edit+reservation/')
> >         #output->append($reservations->find(#curRes)->get(1))
> >         #output->append('/">')
> >         #output->append($reservations->find(#curRes)->get(2))
> >         #output->append('</a></td>')
> >     case // default does not need a test for false.  if it's not true,
> > then it must be false.
> >         ...etc...
> > }
> > #output
> >
> > --steve
> >
> >
> > On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell)
> > pronounced:
> >
> >
> >  Maybe I have been looking at this too long... The code below is
> >> generating this error:
> >>
> >> Lasso Error Code: -9948
> >> Error Description: Definition Not Found: string->invoke(string)
> >> Candidates were: null->invoke()
> >> Error Stack: 301:64 //.../admin-reservations-home.lasso
> >>
> >>
> >> local(
> >> curRes = #quadTime->get(loop_count),
> >> rowsc = $reservations->find(#curRes)->get(4),
> >> colsc = $reservations->find(#curRes)->get(5)
> >> )
> >>
> >> match($reservations->find(#curRes)->get(3)) => {^
> >> case(TRUE)
> >> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc +
> >> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
> >> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
> >> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
> >> case(FALSE)
> >> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc +
> >> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
> >> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
> >> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
> >> ^}
> >>
> >>
> >> * Line 301 is the "td" line under TRUE, position 64 would be the second
> >> occurrence of "#rowsc" in that line.
> >> * #rowsc is an integer (verified)
> >> * Removing #rowsc shifts the error forward to the second occurrence of
> >> #colsc, which is also an integer
> >> * Changing #rowsc to #rowsc->asString (in the second occurrence) changes
> >> nothing
> >>
> >> Help! Probably something stupid easy, but I have been staring at it too
> >> long.
> >>
> >> Marc Pinnell
> >> 1027 Design
> >> PO Box 990872
> >> Redding, CA 96099-0872
> >> 530.941.4706
> >> fax: 866.232.5300
> >> www.1027Design.com
> >>
> >>
> >>
> >> #############################################################
> >>
> >> This message is sent to you because you are subscribed to
> >> the mailing list Lasso [hidden email]
> >> Official list archives available at http://www.lassotalk.com
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >>
> >
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > Steve Piercy              Website Builder              Soquel, CA
> > <[hidden email]>               <http://www.StevePiercy.com/>
> >
> >
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
> >
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: string->invoke(string) error

Marc Pinnell-3
That's how I have declared my locals/vars for some time now. Not sure where I picked it up (probably on this list!). Although the occasional missing comma bites me in the arse, I find it much easier to read.

marc


On Jan 22, 2015, at 4:44 PM, Ke Carlton <[hidden email]> wrote:

> I would take it a step further:
>
> local(
> curRes     = #quadTime->get(loop_count),
> res        = $reservations->find(#curRes),
> resURL     = #res->get(1),
> resURLName = #res->get(2),
> resSuccess = boolean(#res->get(3)),
> rowsc      = integer(#res->get(4)),
> colsc      = integer(#res->get(5))
> )
>
> '<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
> (#rowsc != 0 ? ' rowspan="' + #rowsc + '"') +
> (#colsc > 0 ? ' colspan="' + #colsc + '"') + '>' +
> '<a href="/admin/edit+reservation/' + #resURL + '/">' + #resURLName +
> '</a>' +
> '</td>'
>
> Compacting the locals down to one local declaration and perhaps more
> importantly retaining readability of the html / string by using making the
> most of the trailing +'s...
>
>
> On 23 January 2015 at 03:15, Bil Corry <[hidden email]> wrote:
>
>> Since we're offering up alternative suggestions for coding, here's another
>> way:
>>
>>
>> local(curRes) = #quadTime->get(loop_count);
>> local(res) = $reservations->find(#curRes);
>> local(resURL) = #res->get(1);
>> local(resURLName) = #res->get(2);
>> local(resSuccess) = boolean(#res->get(3));
>> local(rowsc) = integer(#res->get(4));
>> local(colsc) = integer(#res->get(5));
>>
>> '<td class="reserved ' + (#resSuccess ? 'success' | 'warning') + '"' +
>> (#rowsc != 0 ? ' rowspan="' + #rowsc + '"') + (#colsc > 0 ? ' colspan="' +
>> #colsc + '"') + '><a href="/admin/edit+reservation/' + #resURL + '/">' +
>> #resURLName + '</a></td>';
>>
>>
>> - Bil
>>
>>
>> On Wed, Jan 21, 2015 at 9:58 PM, Steve Piercy - Website Builder <
>> [hidden email]> wrote:
>>
>>> When you can't read your own code, it's a sign that you should modify it.
>>> Additionally, it will identify on precisely which line you have a syntax
>>> error.  A long single line of string concatenation makes it harder to
>> find
>>> the error.
>>>
>>> local(output) = string
>>> match($reservations->find(#curRes)->get(3)) => {
>>>    case(true)
>>>        #output->append('<td class="reserved success"')
>>>        #output->append(#rowsc != 0 ? ' rowspan="' + #rowsc + '"')
>>>        #output->append(#colsc > 0 ? ' colspan="' + #colsc + '"')
>>>        #output->append('><a href="/admin/edit+reservation/')
>>>        #output->append($reservations->find(#curRes)->get(1))
>>>        #output->append('/">')
>>>        #output->append($reservations->find(#curRes)->get(2))
>>>        #output->append('</a></td>')
>>>    case // default does not need a test for false.  if it's not true,
>>> then it must be false.
>>>        ...etc...
>>> }
>>> #output
>>>
>>> --steve
>>>
>>>
>>> On 1/21/15 at 10:45 AM, [hidden email] (Marc Pinnell)
>>> pronounced:
>>>
>>>
>>> Maybe I have been looking at this too long... The code below is
>>>> generating this error:
>>>>
>>>> Lasso Error Code: -9948
>>>> Error Description: Definition Not Found: string->invoke(string)
>>>> Candidates were: null->invoke()
>>>> Error Stack: 301:64 //.../admin-reservations-home.lasso
>>>>
>>>>
>>>> local(
>>>> curRes = #quadTime->get(loop_count),
>>>> rowsc = $reservations->find(#curRes)->get(4),
>>>> colsc = $reservations->find(#curRes)->get(5)
>>>> )
>>>>
>>>> match($reservations->find(#curRes)->get(3)) => {^
>>>> case(TRUE)
>>>> '<td class="reserved success"' + (#rowsc != 0 ? ' rowspan="' + #rowsc +
>>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
>>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>>> case(FALSE)
>>>> '<td class="reserved warning"' + (#rowsc > 0 ? ' rowspan="' + #rowsc +
>>>> '"')(#colsc > 0 ? ' colspan="' + #colsc + '"') + '><a
>>>> href="/admin/edit+reservation/' + $reservations->find(#curRes)->get(1) +
>>>> '/">' + $reservations->find(#curRes)->get(2) + '</a></td>'
>>>> ^}
>>>>
>>>>
>>>> * Line 301 is the "td" line under TRUE, position 64 would be the second
>>>> occurrence of "#rowsc" in that line.
>>>> * #rowsc is an integer (verified)
>>>> * Removing #rowsc shifts the error forward to the second occurrence of
>>>> #colsc, which is also an integer
>>>> * Changing #rowsc to #rowsc->asString (in the second occurrence) changes
>>>> nothing
>>>>
>>>> Help! Probably something stupid easy, but I have been staring at it too
>>>> long.
>>>>
>>>> Marc Pinnell
>>>> 1027 Design
>>>> PO Box 990872
>>>> Redding, CA 96099-0872
>>>> 530.941.4706
>>>> fax: 866.232.5300
>>>> www.1027Design.com
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy              Website Builder              Soquel, CA
>>> <[hidden email]>               <http://www.StevePiercy.com/>
>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>