array -> split results in different type

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

array -> split results in different type

Jolle Carlestam-2
Here’s an oddity that bit me right now.

#mytest -> split(regexp(`(;|:)`)) -> type
#mytest -> split(':') -> type

->
staticarray
array


Why does a split using a regexp return a staticarray whereas a regular split return an array?

HDB
Jolle

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

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: array -> split results in different type

Jolle Carlestam-2
24 feb 2015 kl. 12:38 skrev Jolle Carlestam <[hidden email]>:

> Here’s an oddity that bit me right now.
>
> #mytest -> split(regexp(`(;|:)`)) -> type
> #mytest -> split(':') -> type
>
> ->
> staticarray
> array
>
>
> Why does a split using a regexp return a staticarray whereas a regular split return an array?

Found the answer to that myself. And myself is to blame.
Turns out that string ->split(regexp) is something that I’ve added by my own. It does not come with the standard Lasso 9 package…

Well, that means I know how to fix it too…

HDB
Jolle

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

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: array -> split results in different type

Jolle Carlestam-2
24 feb 2015 kl. 12:42 skrev Jolle Carlestam <[hidden email]>:

> Turns out that string ->split(regexp) is something that I’ve added by my own. It does not come with the standard Lasso 9 package…

”by my own” Credits where credits are due. This is the full truth:

/**!
pass a regExp object to [string->split]
Code by Brad Lindsay. Posted to the Lasso beta list 2011-05-01
example:
['fox'->split(regExp(-find='[aeiou]'))]
**/
define string -> split(delim::regExp) => regExp(-input = self, -find = #delim -> findPattern) -> split

Thanks Brad!

HDB
Jolle

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

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
|

Converting from v9 to v8

Ken Braswell
In reply to this post by Jolle Carlestam-2
This piece of code worked in v9 but in v8. V8 generated the below error.

[session_start('user_access', -expires = 60, -useAuto)
        if(session_result('user_access') != 'load') >= {
        var(session_keyfield_value)
        var(session_OrgID_value)
        session_addvar('user_access', 'session_keyfield_value')
        session_addvar('user_access', 'session_OrgID_value')
        }]


Error Message:
No tag, type or constant was defined under the name "if" with arguments: array: (true)

Error Code:
-9948

Dose anyone know what the solution is?
Thank you.

Ken Braswell
cell (732) 309-9228
[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: Converting from v9 to v8

Josh Brinkmeier
Hi Ken,

Lasso 8 does not support capture blocks.

You need to close the if statement with "/if;"

Lasso 8 also requires semicolons at the end of each line and the variable names should be in quotes.

The Lasso 8 code would look like this:


[
        session_start('user_access', -expires = 60, -useAuto);
       
        if(session_result('user_access') != 'load');
                var('session_keyfield_value');
                var('session_OrgID_value');
                session_addvar('user_access', 'session_keyfield_value');
                session_addvar('user_access', 'session_OrgID_value');
        /if;
]

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

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: Converting from v9 to v8

Ken Braswell
Thank you Josh,

That fixed the error but now there is a new error:

Error Message: No tag, type or constant was defined under the name "session_OrgID_value".
Error Code: -9948

This confuses me because “session_OrgID_value” was used the same as “session_keyfield_value”.


On Feb 25, 2015, at 12:19 PM, Josh Brinkmeier <[hidden email]> wrote:

> Hi Ken,
>
> Lasso 8 does not support capture blocks.
>
> You need to close the if statement with "/if;"
>
> Lasso 8 also requires semicolons at the end of each line and the variable names should be in quotes.
>
> The Lasso 8 code would look like this:
>
>
> [
> session_start('user_access', -expires = 60, -useAuto);
>
> if(session_result('user_access') != 'load');
> var('session_keyfield_value');
> var('session_OrgID_value');
> session_addvar('user_access', 'session_keyfield_value');
> session_addvar('user_access', 'session_OrgID_value');
> /if;
> ]
>
> #############################################################
>
> 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]>

Ken Braswell
cell (732) 309-9228
[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: Converting from v9 to v8

Marc Pinnell-3
Can you post your actual code?

On Feb 25, 2015, at 9:51 AM, Ken Braswell <[hidden email]> wrote:

> Thank you Josh,
>
> That fixed the error but now there is a new error:
>
> Error Message: No tag, type or constant was defined under the name "session_OrgID_value".
> Error Code: -9948
>
> This confuses me because “session_OrgID_value” was used the same as “session_keyfield_value”.
>
>
> On Feb 25, 2015, at 12:19 PM, Josh Brinkmeier <[hidden email]> wrote:
>
>> Hi Ken,
>>
>> Lasso 8 does not support capture blocks.
>>
>> You need to close the if statement with "/if;"
>>
>> Lasso 8 also requires semicolons at the end of each line and the variable names should be in quotes.
>>
>> The Lasso 8 code would look like this:
>>
>>
>> [
>> session_start('user_access', -expires = 60, -useAuto);
>>
>> if(session_result('user_access') != 'load');
>> var('session_keyfield_value');
>> var('session_OrgID_value');
>> session_addvar('user_access', 'session_keyfield_value');
>> session_addvar('user_access', 'session_OrgID_value');
>> /if;
>> ]
>>
>> #############################################################
>>
>> 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]>
>
> Ken Braswell
> cell (732) 309-9228
> [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: Converting from v9 to v8

Josh Brinkmeier
In reply to this post by Ken Braswell
That error sounds like the result of the session_OrgID_value variable being called somewhere in your code without quotes.

I would do a quick find for "var(session_OrgID_value)" and replace all instances with "var('session_OrgID_value')".



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

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: Converting from v9 to v8

Ken Braswell
OK I will take a look.

Thank you very much for helping.


On Feb 25, 2015, at 1:06 PM, Josh Brinkmeier <[hidden email]> wrote:

> That error sounds like the result of the session_OrgID_value variable being called somewhere in your code without quotes.
>
> I would do a quick find for "var(session_OrgID_value)" and replace all instances with "var('session_OrgID_value')".
>
>
>
> #############################################################
>
> 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]>

Ken Braswell
cell (732) 309-9228
[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]>