Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3).
Navigation
Topics Help • Register • News • History • How to • Sequences statistics • Template prototypes

Difference between revisions of "Template:GP"

From Prime-Wiki
Jump to: navigation, search
(extended)
Line 19: Line 19:
 
*<nowiki>{{GP|Riesel prime 65|RDate}}</nowiki> (using MultiReservation) results in
 
*<nowiki>{{GP|Riesel prime 65|RDate}}</nowiki> (using MultiReservation) results in
 
:{{GP|Riesel prime 65|RDate}}
 
:{{GP|Riesel prime 65|RDate}}
[[Category:Templates]]
+
[[Category:Templates]]</noinclude><includeonly><!--
</noinclude><includeonly>{{#if:{{#pos:{{{1}}}|Williams}}|{{#vardefine:q|Williams prime}}|{{#vardefine:q|{{#sub:{{{1}}}|0|{{#rpos:{{{1}}}| }}}}}}}}<!--
+
-->{{#vardefine:_type|none}}<!--
-->{{#vardefine:m|{{#dpl:title={{{1}}}|skipthispage=no|include={ {{#var:q}}}:{{#sub:{{{1}}}|0|1}}MultiRes}}}}<!--
+
-->{{#vardefine:_short|none}}<!--
-->{{#ifexist:{{{1}}}|{{#dpl:title={{{1}}}|skipthispage=no|include={ {{#var:q}}}:{{{2}}}}}}}<!--
+
-->{{#if:{{#pos:{{{1}}}|Carol}}|{{#vardefine:_type|Carol-Kynea prime}}{{#vardefine:_short|CK}}}}<!--
-->{{#if:{{#var:m}}|
+
-->{{#if:{{#pos:{{{1}}}|Cullen}}|{{#vardefine:_type|Cullen prime}}{{#vardefine:_short|Cu}}}}<!--
 +
-->{{#if:{{#pos:{{{1}}}|Leyland}}|{{#vardefine:_type|Leyland prime}}{{#vardefine:_short|Le}}}}<!--
 +
-->{{#if:{{#pos:{{{1}}}|Proth}}|{{#vardefine:_type|Proth prime}}{{#vardefine:_short|P}}}}<!--
 +
-->{{#if:{{#pos:{{{1}}}|Riesel}}|{{#vardefine:_type|Riesel prime}}{{#vardefine:_short|R}}}}<!--
 +
-->{{#if:{{#pos:{{{1}}}|Williams}}|{{#vardefine:_type|Williams prime}}{{#vardefine:_short|Wi}}}}<!--
 +
-->{{#if:{{#pos:{{{1}}}|Woodall}}|{{#vardefine:_type|Woodall prime}}{{#vardefine:_short|Wo}}}}<!--
 +
-->{{#if:{{#pos:{{{1}}}|Gen}}|{{#vardefine:_type|Gen {{#var:_type}}}}}}<!--
 +
-->{{#vardefine:_mres|none}}<!--
 +
-->{{#vardefine:_mres|{{#ifexist:{{{1}}}|{{#dpl:title={{{1}}}|skipthispage=no|include={ {{#var:_type}}}:{{#var:_short}}MultiRes}}}}}}<!--
 +
-->{{#ifexist:{{{1}}}|{{#if:{{#var:_mres}}|
 
   {{#switch:{{{2}}}
 
   {{#switch:{{{2}}}
   |RMaxn |PMaxn={{Multi Reservation:{{#var:m}}-NMax}}
+
   |RMaxn |PMaxn={{Multi Reservation:{{#var:_mres}}-NMax}}
   |RDate |PDate={{Multi Reservation:{{#var:m}}-Date}}
+
   |RDate |PDate={{Multi Reservation:{{#var:_mres}}-Date}}
 
   }}
 
   }}
 +
  |{{#dpl:title={{{1}}}|skipthispage=no|include={ {{#var:_type}}}:{{{2}}}}}}}
 
}}</includeonly>
 
}}</includeonly>

Revision as of 14:59, 23 May 2020

Description

Get a parameter value of a template by name if exists, "" (null) otherwise.

Call

{{GP|<prime name>|<Parameter>}}

Examples

Get the parameter "CKReserved" from "Carol-Kynea base 2" primes

  • {{GP|Carol-Kynea prime 2|CKBase}} results in
2
  • {{GP|Riesel prime 15|RMaxn}} results in
  • {{GP|Riesel prime 65|RMaxn}} (using MultiReservation) results in
  • {{GP|Riesel prime 65|RDate}} (using MultiReservation) results in