Files
harbour-core/harbour/examples/uhttpd2/uhbext.prg
Viktor Szakats d3e965d9a2 2009-06-15 20:37 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* examples/uhttpd2/uwidgets.prg
  * examples/uhttpd2/uhbext.prg
  * examples/uhttpd2/app.prg
  + examples/uhttpd2/umutex.c
    * Embedded C moved to separate file.
    % Using Harbour's hb_HGetDef() instead of local version.
2009-06-15 18:37:38 +00:00

36 lines
822 B
Plaintext

/*
* $Id$
*/
/************************************************************
*
* Functions candidates to be a part of Harbour's core or RTL
*
*************************************************************/
FUNC split(cSeparator, cString)
LOCAL aRet := {}, nI
DO WHILE (nI := AT(cSeparator, cString)) > 0
AADD(aRet, LEFT(cString, nI - 1))
cString := SUBSTR(cString, nI + LEN(cSeparator))
ENDDO
AADD(aRet, cString)
RETURN aRet
FUNC join(cSeparator, aData)
LOCAL cRet := "", nI
FOR nI := 1 TO LEN(aData)
IF nI > 1; cRet += cSeparator
ENDIF
IF VALTYPE(aData[nI]) $ "CM"; cRet += aData[nI]
ELSEIF VALTYPE(aData[nI]) == "N"; cRet += LTRIM(STR(aData[nI]))
ELSEIF VALTYPE(aData[nI]) == "D"; cRet += IF(!EMPTY(aData[nI]), DTOC(aData[nI]), "")
ELSE
ENDIF
NEXT
RETURN cRet