UtterAccess HomeUtterAccess Wiki

Welcome Guest ( Log In | Register )

Custom Search
Edit Discussion
> FL Usage    

Contents

Description

The Function Library Template (FL) formats Function Library submissions, automatically creates a Function Library contents entry, and adds Creative Commons licencing information to you article. The template has five parameters which you can use to include relevant information in the article header.

Parameters

Synopsis - a brief one or two sentence description of what the function does

Rev - the revision or version number. If you do not enter a rev value it defaults to 1.0

Desc - revision description the function is modified

YYYY-MM-DD - the date you wrote the function

FunctionBody - the actual function code

Using the Template

When you want to post a Function Library article begin the article with {{FL Then enter one line for each parameter you want to include. The line should begin with the pipe symbol (|) After the pipe symbol, type the name of the parameter followed by an equal sign followed by the value you want to assign to the parameter. For example: |Synopsis=Count to ten the FunctionBody parameter should be last, immediately followed by your code |FunctionBody= Public Sub sCountTo10() dim icntr as Integer for icntr = 1 to 10 next End Function Finally, type two closing braces to finish the Template call.

Example

If you type this in your article:

{{FL

|Synopsis=Count to ten
|YYYY-MM-DD=2010-11-09
|FunctionBody=
Public Sub sCountTo10()

  dim icntr as Integer
for icntr = 1 to 10
next

End Function
}}

this will be the result:


Synopsis

Count to ten

CODE
' FL Usage
' http://www.utteraccess.com/wiki/FL_Usage
' Code courtesy of UtterAccess Wiki
' Licensed under Creative Commons License
' http://creativecommons.org/licenses/by-sa/3.0/
'
' You are free to use this code in any application,
' provided this notice is left unchanged.
'
' rev  date                          brief descripton
' 1.0  2010-11-09                    
'
Public Sub sCountTo10()
  dim icntr as Integer

  for icntr = 1 to 10
 
  next

End Function

Creative Commons License
FL Usage by UtterAccess Wiki is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Editing and revision of the content is freely encouraged; for details, see Expected Usage.


Bug with Pipe and <> Characters

Please note that there is an existing bug in the FL template which effects the Pipe character (|) and the Greater Than and Less Than (<>) characters.

The Pipe (|) Character

The existence of the pipe character in code entered in the template erroneously indicates the start of the next template parameter. Therefore, while using the FL template, we will see unexpected formatting if the code contains a pipe character.

The GT/LT (<>) Characters

As part of the display process for templates includes rendering to HTML formatting, the Greater Than and Less Than characters within the FL Template will be erroneously displayed as "& g t ;" and "& l t ;" in the procedure.

The Fix

If your procedure contains either Pipe or GT/LT characters, you can wrap the GT/LT characters in the <nowiki> tags so they will display correctly. For the Pipe character to display correctly with the FL template, you must replace each occurance of the Pipe with the template {{!}}.

As an alternative workaround, there is a template called FLFooter, which is to be placed after your complete code entry. This template includes the license information and the category link to the Function Library.

Please ensure to include function header comments similar to that used in the standard FL template, as indicated above.

Example:

</nowiki></br><nowiki> Your Synopsis Here
[code]
'===========
' Your function header comments here
'===========
' Your Function Body Here
Sub DoStuff()
'do my stuff
End Sub
[/code]
{{FLFooter}}

Edit Discussion
Custom Search
Thank you for your support!
This page has been accessed 8,335 times.  This page was last modified 13:33, 17 April 2011 by Jack Leach. Contributions by Glenn Lloyd  Disclaimers