Jul 01
Roy William Gabrielsen Script stop working on 8.6.1
Jul 01, 2013; 18:16
Roy William Gabrielsen
Script stop working on 8.6.1
Dear list
This script worked on Mac OS X with Lasso 8.5.6
Stop working on CentOS with Lasso 8.6.1
Where to look ?
Thanx!
Roy G
<?LassoScript
//
// The only required variable is called "maxpages" and refers to the
// maximum number of clickable page links displayed on the results page.
//[
var: 'maxpages'=12;
inline:
-Database='Landskonkurransen2013',
-Layout='poeng',
-KeyField='Internal record ID',
'Gruppe'='3',
'p'='p',
-ReturnField='navn',
-ReturnField='gruppe',
-SkipRecords=(SkipRecords_Value),
-MaxRecords='1',
-SortField='poeng',
-SortOrder='Descending',
-Search;
//]
// We start by analysing the given SkipRecords value to establish how many page
// links should be displayed, and from which page we start numbering in case the
// user jumped to the next set of pages.
//[
var: 'skip'=((Integer:(SkipRecords_Value)) + (Integer:(MaxRecords_Value)));
var:'pages'=(Math_Ceil: ((decimal:(found_count)) / (decimal: (MaxRecords_Value))));
If:$pages>=$maxpages; var:'pages'=$maxpages; /If; var:'page_calc'=(((Math_Floor:($skip / (decimal:((MaxRecords_Value) * $maxpages)))) * $maxpages) + 1); If:(math_mod:$skip, ((MaxRecords_Value) * $maxpages))==0; If:$skip==((MaxRecords_Value) * $maxpages); var:'page_no'=1; var:'skip2'=0; else; var:'page_no'=($page_calc - $maxpages); var:'skip2'=(((Math_Floor:($skip / (decimal:((MaxRecords_Value) * $maxpages)))) * ((MaxRecords_Value) * $maxpages)) - ((MaxRecords_Value) * $maxpages)); /If; Else; var:'page_no'=$page_calc; var:'skip2'=((Math_Floor:($skip / (decimal:((MaxRecords_Value) * $maxpages)))) * ((MaxRecords_Value) * $maxpages)); /If; '
<p>\n';
//]
// The first possible hyperlink will lead the user to the very first record from
// anywhere in the found set.
//[
If: (Shown_First)>=(MaxRecords_Value);
'<A HREF="bryllup.lasso?-SkipRecords=0"><span class="text">Første</span></A> ';
else;
'<span class="silver">Første</span> ';
/if;
//]
// The second hyperlink, if applicable, is there to jump to the previous set of
// results pages
//[
If: $skip2>0;
'<A HREF="bryllup.lasso?-SkipRecords=' + ((($page_no - 1) * (maxrecords_value)) - (maxrecords_value)) + '"><span class="text">Bakover</span></a> ';
Else;
'<span class="silver">Bakover</span> ';
/If;
//]
// The third hyperlink, if applicable, simply brings the user to the previous
// results page
//[
If: ($skip>(MaxRecords_Value));
'<A HREF="bryllup.lasso?-SkipRecords=' + ($skip - ((MaxRecords_Value) * 2)) + '"><span class="text">Forrige</span></a> ';
Else;
'<span class="silver">Forrige</span> ';
/If;
//]
// Finally getting to the all important hyperlinks to individual pages.
// This part of the routine uses the maxpages variable to define the
// maximum number of page links to be displayed, which means that the user
// may have clicked to the next or previous set of pages (see second
// hyperlink description above). If the maximum is set to 10 with a
// Maxrecords value of 10 and a found set of 200 records, the 'pages' and
// "page_no" variables take care of the correct page numbering, e.g 11-20
// for the second 'set'.
//[
loop: $pages;
If:(((skiprecords_value) / (maxrecords_value)) + 1)==$page_no;
'<span class="text"><b><u>' + $page_no + '</u></b></span>';
else;
'<A HREF="bryllup.lasso?-SkipRecords=' + $skip2 + '"><span class="text">' + $page_no + '</span></a>';
/If;
' ';
var:'page_no'=($page_no + 1),
'skip2'=($skip2 + (MaxRecords_Value));
If: $skip2 >= (found_count);
Loop_Abort;
/If;
/loop;
//]
// The equivalent of the third hyperlink, pointing to the next results page.
//[
If: (found_count>$skip);
' <A HREF="bryllup.lasso?-SkipRecords=' + $skip + '"><span class="text">Neste</span></a>';
Else;
' <span class="silver">Neste</span>';
/If;
//]
// The equivalent of the second hyperlink, jumping to the next set of pages.
//[
If: $skip2<(found_count);
' <A HREF="bryllup.lasso?-SkipRecords=' + $skip2 + '"><span class="text">Forover</span></a>';
Else;
' <span class="silver">Forover</span>';
/If;
//]
// The last hyperlink requires some additional calculations, courtesy of
// Michael Collins, to bring the user to the page displaying the very last
// record.
//[
If: ((Found_Count) % (MaxRecords_Value))==0;
Var:'Skip'=((Found_Count) - (MaxRecords_Value));
else;
Var:'Skip'=((MaxRecords_Value) * (Math_Floor:(decimal:(Found_Count)) / (decimal:(MaxRecords_Value))));
/If;
If:(($Skip) <= (Found_Count))&&((Shown_Last)!=(Found_Count));
' <A HREF="bryllup.lasso?-SkipRecords=' + $Skip + '"><span class="text">Siste</span></A>';
else;
'<span class="silver"> Siste</span>';
/if;
/inline;
?>
#############################################################
Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jul 01
Roy William Gabrielsen Re: Script stop working on 8.6.1
Jul 01, 2013; 18:32
Roy William Gabrielsen
Re: Script stop working on 8.6.1
Jul 01
Steve Piercy - Web Site Builder Re: Script stop working on 8.6.1
Jul 01, 2013; 15:56
Steve Piercy - Web Site Builder
Re: Script stop working on 8.6.1
Aug 12
Roy William Gabrielsen Re: Script stop working on 8.6.1
Aug 12, 2013; 02:05
Roy William Gabrielsen
Re: Script stop working on 8.6.1
Aug 11
Steve Piercy - Web Site Builder Re: Script stop working on 8.6.1
Aug 11, 2013; 18:25
Steve Piercy - Web Site Builder
Re: Script stop working on 8.6.1
Aug 11
Rachel Guthrie Re: Script stop working on 8.6.1
Aug 11, 2013; 22:58
Rachel Guthrie
Re: Script stop working on 8.6.1
Aug 12
Roy William Gabrielsen Re: Script stop working on 8.6.1
Aug 12, 2013; 05:50
Roy William Gabrielsen
Re: Script stop working on 8.6.1
Aug 12
Steve Piercy - Web Site Builder Re: Script stop working on 8.6.1
Aug 12, 2013; 00:05
Steve Piercy - Web Site Builder
Re: Script stop working on 8.6.1
Aug 12
Steve Piercy - Web Site Builder Re: Script stop working on 8.6.1
Aug 12, 2013; 00:05
Steve Piercy - Web Site Builder
Re: Script stop working on 8.6.1
Aug 12
Johan Solve Re: Script stop working on 8.6.1
Aug 12, 2013; 14:04
Johan Solve
Re: Script stop working on 8.6.1
Aug 12
Johan Solve Re: Script stop working on 8.6.1
Aug 12, 2013; 14:55
Johan Solve
Re: Script stop working on 8.6.1
Aug 12
Jonathan Guthrie Re: Script stop working on 8.6.1
Aug 12, 2013; 10:19
Jonathan Guthrie
Re: Script stop working on 8.6.1
Aug 12
Johan Solve Re: Script stop working on 8.6.1
Aug 12, 2013; 16:43
Johan Solve
Re: Script stop working on 8.6.1
Aug 12
Johan Solve Re: Script stop working on 8.6.1
Aug 12, 2013; 16:45
Johan Solve
Re: Script stop working on 8.6.1
Aug 12
Roy William Gabrielsen Re: Script stop working on 8.6.1
Aug 12, 2013; 17:12
Roy William Gabrielsen
Re: Script stop working on 8.6.1