Leave feedback
  • Question

    * Share your function files here*

Enter a new topic
  • Stefan Cohen Stefan Cohen StreamServe Employee Administrator
    1 likes 5078 views

    This forum topic is for sharing function files in the StreamShare community. You can participate by replying to this Topic and attach your own .fcn file in a reply to this topic.

    Guidelines:

    1. Only attach one file/function per reply.
    2. Clearly describe what the function does in the reply. Document the function arguments, return value, set variables, tricks, caveats, etc...
    3. Keep the thread free from questions and discussions. The idea is that this thread only acts as a function library. Start a new topic and link to this topic in case you have questions. You can also use private messages to the author if you want to communicate with or notify the author directly.
    4. By submiting your function file to streamshare, you agree to give every community member a license to download, modify, redistribute and use your function for any purpose.
    5. If you find a function useful, please use the vote function to let the authour know that you liked it.
    6. If you improve a function you found here and want to share your modification by submiting your updated function, please acknowledge the original author in your reply.

    To attach a function file in a reply, browse for the file to attach and don't forget to click the "Add" button to opload the attachment before you click "Publish"

     

    I hope there are many members who are willing to share their function files for the benefit of the community.

    Regards,

    Stefan

     

    Wednesday 02 June, 2010
  • Stefan Cohen Stefan Cohen StreamServe Employee Administrator
    0 likes

    TimeDiff()

    A function that will calculate the duration between two timestamps.

    //****************************************************************** *************
    //* Time Converter For StreamServe
    //*
    //* Created date : 1999-04-26 By StreamServe
    //* Modify : 1999-04-26
    //*
    //* ********************************************************************** *******

    //******************************************************************** ***********
    //* -> $start_time & $end_time -> Input to be convert
    //* <- timediff() <- Return Data
    //*
    //******************************************************************** ***********

    Wednesday 02 June, 2010

    Attached files

  • Vyv Lomax Vyv Lomax Administrator
    0 likes

    Here is a function to convert amounts into words. For a few different languages:

    • English
    • Spanish
    • Polish
    • Arabic
    • French
    Wednesday 02 June, 2010
  • Andrew Michnik Andrew Michnik StreamServe Employee
    0 likes

    If you need to take snapshots of environments which are active try xcopy

    set backupDate=20100618_1206
    xCopy MVXOUTv412 "D:\[StreamServeBackup\customer\%backupDate%\" /E /V /I /H /R /Y /C

    Sunday 20 June, 2010
  • Hans-Joachim Schliski Hans-Joachim Schliski
    3 likes

    trace_var()

    function will trace value of a variable

    //-------------------------------------------------------------
    // traces name and value of a variable in the log,
    // if control-Variables says so.
    // log-output is of the form: Trace-Var - name >Value<
    //
    // IN name = first word should be the variable name, some text could follow.
    //
    // control-Variables
    // IN global t_traceit
    // IN global t_PageOutName = $PageOutName tracen!
    //
    //-------------------------------------------------------------

    Thursday 24 June, 2010

    Attached files

  • Stefan Cohen Stefan Cohen StreamServe Employee Administrator
    0 likes

    iso3166_1()

    A function to convert between country names (official short names in English) in alphabetical order as given in ISO 3166-1
    and the corresponding ISO 3166-1-alpha-2 code elements.

    Input: <str> an ISO 3166-1-alpha-2 code or official short name in English
    Output : <str> Official short name in English or ISO 3166-1-alpha-2 code

    The function will attempt to automatically detect if the input is an ISO 3166-1-alpha-2 code or an official short name country name and convert accordingly.

    Example1: ISO3166_1("AL");
    result: "ALBANIA"

    Example 2: ISO3166_1("ANDORRA");
    result: "AD"

    Wednesday 30 June, 2010
  • Stefan Cohen Stefan Cohen StreamServe Employee Administrator
    0 likes

    ... and I forgot to attach the file ;)

    Wednesday 30 June, 2010

    Attached files

  • Stefan Cohen Stefan Cohen StreamServe Employee Administrator
    0 likes

    dec2bin()

    A function to convert a positive integer in decimal form to binary form.

    Input: A decimal number to cunvert. Ex: dec2bin(123);

    Output: The input number in binary form. Ex: 1111011

    Wednesday 30 June, 2010

    Attached files

  • Vyv Lomax Vyv Lomax Administrator
    0 likes

    An email validation function

    Wednesday 05 January, 2011
  • Vyv Lomax Vyv Lomax Administrator
    0 likes

    And another little group of functions.

    Wednesday 05 January, 2011
  • Vyv Lomax Vyv Lomax Administrator
    0 likes

    A Bubble Sort (ASC / DESC) (Untested) (Many thanks to Stig Larsen)

    // Bubble sort array - DESCENDING NUMERIC

    $arraySize = arraySize($myArray);
    $i = 0;
    while(num($i) < num($arraySize))
    {
      $j = 1;
      while(num($j) < num($arraySize))
      {
       if(num($myArray[$j]) <= num($myArray[$i]))
       {
        $tmp = $myArray[$i];
        $myArray[$i] = $myArray[$j];
        $myArray[$j] = $tmp;
       }
       $j++;
      }
      $i++;
    }


    // Bubble sort array - ASCENDING NUMERIC

    $arraySize = arraySize($myArray);
    $i = 0;
    while(num($i) < num($arraySize))
    {
     $j = 0;
     while(num($j) < num($arraySize))
     {
      if(num($myArray[$j]) >= num($myArray[$i]))
      {
       $tmp = $myArray[$i];
       $myArray[$i] = $myArray[$j];
       $myArray[$j] = $tmp;
      }
      $j++;
     }
     $i++;
    }

    Tuesday 28 June, 2011
Next

 

Latest from the blogs

Read more