home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 December / PCWKCD1296.iso / wtest / micrsoft / vbasic4 / vb4-1.cab / demo.mdb / Functions.json < prev    next >
Encoding:
JavaScript Object Notation  |  1995-08-15  |  5.7 KB

  1. {
  2.     "schema": {
  3.         "ID": "Long Integer",
  4.         "Parent": "Long Integer NOT NULL",
  5.         "Name": "Text (40) NOT NULL",
  6.         "Category": "Text (40)",
  7.         "Comment": "Text (255)",
  8.         "Code": "Memo/Hyperlink (255) NOT NULL",
  9.         "Declaration": "Memo/Hyperlink (255)",
  10.         "Constant": "Memo/Hyperlink (255)"
  11.     },
  12.     "data": [
  13.         {
  14.             "ID": 1,
  15.             "Parent": 1,
  16.             "Name": "Backslash",
  17.             "Category": "Unassigned",
  18.             "Code": "'--------------------------------------------------------------------------\r\n'<Purpose>\r\n'   Adds, or removes a backslash to a string.\r\n'<Syntax>\r\n'   Backslash(ThisPath, ThisAction)\r\n'\r\n'   Part                Description\r\n'   ------------------  ---------------------------------------------------\r\n'   ThisPath            Required. Path to check.\r\n'   ThisAction          Required. Action define operation (Add/Remove) to\r\n'                       perform on 'ThisPath'.\r\n'<Settings>\r\n'   The 'ThisAction' argument settings are:\r\n'   Constant            Value   Description\r\n'   ------------------  ------  -------------------------------------------\r\n'   afwAddBackslash     1       Adds backslash if not already there.\r\n'   afwRemoveBackslash  2       Removes backslash, if found.\r\n'<Remarks>\r\n'   Modified version of 'ThisPath'.\r\n'\r\n'   Use in conjunction with file paths.\r\n'--------------------------------------------------------------------------\r\nPublic Function Backslash(ThisPath As String, ThisAction As Integer) As String\r\n    Select Case ThisAction\r\n        Case afwAddBackslash\r\n            If (Right(ThisPath, 1) = \"\\\") Then\r\n                Backslash = ThisPath\r\n            Else\r\n                Backslash = ThisPath & \"\\\"\r\n            End If\r\n        Case afwRemoveBackslash\r\n            If (Right(ThisPath, 1) = \"\\\") Then\r\n                Backslash = Left(ThisPath, Len(ThisPath) - 1)\r\n            Else\r\n                Backslash = ThisPath\r\n            End If\r\n    End Select\r\n    \r\nEnd Function\r\n",
  19.             "Constant": "'backslash constants -------------------------\r\nPublic Const afwAddBackslash    As Integer = 1\r\nPublic Const afwRemoveBackslash As Integer = 2\r\n"
  20.         },
  21.         {
  22.             "ID": 2,
  23.             "Parent": 1,
  24.             "Name": "GetKeyString",
  25.             "Category": "Unassigned",
  26.             "Code": "'--------------------------------------------------------------------------\r\n'<Purpose>\r\n'   Retrieves a stored string parameter from a .INI file\r\n'<Syntax>\r\n'   GetKeyString(AppName, KeyName, FileName)\r\n'\r\n'   Part                Description\r\n'   ------------------  ---------------------------------------------------\r\n'   KeyName             Required. Name of the parameter to retrieve.\r\n'   AppName             Required. Name of the subsection to find it in.\r\n'   FileName            Required. Name of the .INI file\r\n'<Remarks>\r\n'   Returns string key value.\r\n'\r\n'   The following Windows API('s) must be declared before using this\r\n'   function:\r\n'       GetPrivateProfileString()\r\n'--------------------------------------------------------------------------\r\nPublic Function GetKeyString(AppName As String, KeyName As String, FileName As String) As String\r\n    #If Win16 Then\r\n        Dim ReturnCode As Integer\r\n    #Else\r\n        Dim ReturnCode As Long\r\n    #End If\r\n    Dim KeyValue   As String * 256\r\n\r\n    ReturnCode = GetPrivateProfileString(AppName, KeyName, \"DEFAULT\", KeyValue, Len(KeyValue), FileName)\r\n    If (Left(KeyValue, 7) = \"DEFAULT\") Then\r\n       GetKeyString = \"\"\r\n    Else\r\n        GetKeyString = Left(KeyValue, ReturnCode)\r\n    End If\r\n    \r\nEnd Function\r\n",
  27.             "Declaration": "    Declare Function GetPrivateProfileString Lib \"Kernel\" (ByVal AppName As String, ByVal KeyName As String, ByVal KeyDefault As String, ByVal ReturnString As String, ByVal NumBytes As Integer, ByVal FileName As String) As Integer\r\n"
  28.         },
  29.         {
  30.             "ID": 3,
  31.             "Parent": 1,
  32.             "Name": "DayOfWeek",
  33.             "Category": "Unassigned",
  34.             "Comment": "Find",
  35.             "Code": "'--------------------------------------------------------------------------\r\n'<Purpose>\r\n'   Return the day of the week given date as a string.\r\n'<Syntax>\r\n'   DayOfWeek(ThisDay)\r\n'\r\n'   Part                Description\r\n'   ------------------  ---------------------------------------------------\r\n'   ThisDay             Required. Date in format mm/dd/yy.\r\n'<Remarks>\r\n'   Returns string containing day of week (Sunday, Monday,..., Saturday).\r\n'   If 'ThisDay' is a empty string (\"\") or is NULL then an empty string\r\n'   (\"\") is returned.\r\n'--------------------------------------------------------------------------\r\nPublic Function DayOfWeek(ThisDay As String) As String\r\n        \r\n    If (Len(Trim(ThisDay)) = 0 Or IsNull(ThisDay)) Then\r\n        DayOfWeek = \"\"\r\n        Exit Function\r\n    End If\r\n\r\n    Select Case WeekDay(DateValue(ThisDay))\r\n        Case vbSunday:    DayOfWeek = \"Sunday\"\r\n        Case vbMonday:    DayOfWeek = \"Monday\"\r\n        Case vbTuesday:   DayOfWeek = \"Tuesday\"\r\n        Case vbWednesday: DayOfWeek = \"Wednesday\"\r\n        Case vbThursday:  DayOfWeek = \"Thursday\"\r\n        Case vbFriday:    DayOfWeek = \"Friday\"\r\n        Case vbSaturday:  DayOfWeek = \"Saturday\"\r\n        Case Else:        DayOfWeek = \"\"\r\n    End Select\r\n        \r\nEnd Function\r\n",
  36.             "Declaration": "    Declare Function GetWindow Lib \"User\" (ByVal hWnd As Integer, ByVal wCmd As Integer) As Integer\r\n    Declare Function GetWindowsDirectory Lib \"Kernel\" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer\r\n",
  37.             "Constant": "'listtime() constants -------------------------\r\nPublic Const afwTimeIncrement15 As Integer = 15\r\nPublic Const afwTimeIncrement30 As Integer = 30\r\nPublic Const afwTimeIncrement60 As Integer = 60\r\n"
  38.         },
  39.         {
  40.             "ID": 4,
  41.             "Parent": 1,
  42.             "Name": "Header One",
  43.             "Comment": "Format",
  44.             "Code": "'------------------------------------------\r\n'<AppFramework>\r\n'------------------------------------------"
  45.         }
  46.     ]
  47. }