[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Create Harbour OOP classes for the functionality described: Harbour contribution module 'gtwvg' (): contrib/gtwvg/scrollbr.prg. Defines classes: WvgScrollBar. This file provides platform-specific functionality

[Assistant]
#include "hbclass.ch"
#include "inkey.ch"
#include "hbgtinfo.ch"

#include "hbgtwvg.ch"
#include "wvtwin.ch"
#include "wvgparts.ch"

CREATE CLASS WvgScrollBar INHERIT WvgWindow, WvgDataRef

   VAR    autoTrack                             INIT .T.
   VAR    range                                 INIT { 0, 1 }
   VAR    scrollBoxSize                         INIT -1
   VAR    type                                  INIT WVGSCROLL_HORIZONTAL
   VAR    excludeScrollBox                      INIT .F.

   VAR    sl_xbeSB_Scroll

   VAR    lTracking                             INIT .F.

   METHOD new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
   METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
   METHOD configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible )  VIRTUAL
   METHOD destroy()
   METHOD handleEvent( nMessage, aNM )

   METHOD Scroll( xParam )                      SETGET

   METHOD setRange( aRange )
   METHOD setScrollBoxSize( nUnits )

ENDCLASS

METHOD WvgScrollBar:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )

   ::WvgWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )

   ::style       := WS_CHILD
   ::className   := "SCROLLBAR"
   ::objType     := objTypeScrollBar

   RETURN Self

METHOD WvgScrollBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )

   ::wvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )

   IF ::type == WVGSCROLL_VERTICAL
      ::style += SBS_VERT
   ELSE
      ::style += SBS_HORZ
   ENDIF

   ::oParent:AddChild( Self )

   ::createControl()

   IF ::isParentCrt()
      ::SetWindowProcCallback()
   ENDIF

   ::setRange( ::range )

   IF ::visible
      ::show()
   ENDIF
   ::setPosAndSize()

   RETURN Self

METHOD WvgScrollBar:handleEvent( nMessage, aNM )

   LOCAL nScrMsg, nScrPos, nCommand

   DO CASE
   CASE nMessage == HB_GTE_RESIZED
      IF ::isParentCrt()
         ::rePosition()
      ENDIF
      ::sendMessage( WM_SIZE, 0, 0 )

   CASE nMessage == HB_GTE_CTLCOLOR
      IF HB_ISNUMERIC( ::hBrushBG )
         wvg_SetBkMode( aNM[ 1 ], 1 )
         RETURN ::hBrushBG
      ENDIF

   CASE nMessage == HB_GTE_HSCROLL
      IF ::isParentCrt()
         ::oParent:setFocus()
      ENDIF

      IF ! HB_ISBLOCK( ::sl_xbeSB_Scroll )
         RETURN EVENT_UNHANDELLED
      ENDIF

      nScrMsg := aNM[ 1 ]
      IF nScrMsg == SB_THUMBPOSITION .OR. nScrMsg == SB_THUMBTRACK
         nScrPos := aNM[ 2 ]
      ELSE
         nScrPos := wapi_GetScrollPos( ::pWnd, SB_CTL )
      ENDIF

      DO CASE
      CASE nScrMsg == SB_LEFT
         nCommand := WVGSB_PREVPOS
         IF nScrPos > ::range[ 1 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, --nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_RIGHT
         nCommand := WVGSB_NEXTPOS
         IF nScrPos < ::range[ 2 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, ++nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_LINELEFT
         nCommand := WVGSB_PREVPAGE
         IF nScrPos > ::range[ 1 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, --nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_LINERIGHT
         nCommand := WVGSB_NEXTPAGE
         IF nScrPos < ::range[ 2 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, ++nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_PAGELEFT
         nCommand := WVGSB_PREVPAGE
         IF nScrPos > ::range[ 1 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, --nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_PAGERIGHT
         nCommand := WVGSB_NEXTPAGE
         IF nScrPos < ::range[ 2 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, ++nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_THUMBPOSITION
         nCommand := WVGSB_SLIDERTRACK
         wapi_SetScrollPos( ::pWnd, SB_CTL, nScrPos, .T. )

      CASE nScrMsg == SB_THUMBTRACK
         nCommand := WVGSB_ENDTRACK
         wapi_SetScrollPos( ::pWnd, SB_CTL, nScrPos, .T. )

      CASE nScrMsg == SB_ENDSCROLL
         nCommand := WVGSB_ENDSCROLL
         wapi_SetScrollPos( ::pWnd, SB_CTL, nScrPos, .T. )

      ENDCASE

      ::sl_editBuffer := nScrPos
      Eval( ::sl_xbeSB_Scroll, { nScrPos, nCommand }, , Self )
      RETURN EVENT_HANDELLED

   CASE nMessage == HB_GTE_VSCROLL
      IF ::isParentCrt()
         ::oParent:setFocus()
      ENDIF

      nScrMsg := aNM[ 1 ]
      IF nScrMsg == SB_THUMBPOSITION .OR. nScrMsg == SB_THUMBTRACK
         nScrPos := aNM[ 2 ]
      ELSE
         nScrPos := wapi_GetScrollPos( ::pWnd, SB_CTL )
      ENDIF

      IF ! HB_ISBLOCK( ::sl_xbeSB_Scroll )
         RETURN EVENT_UNHANDELLED
      ENDIF

      DO CASE
      CASE nScrMsg == SB_TOP
         nCommand := WVGSB_TOP
         IF nScrPos > ::range[ 1 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, --nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_BOTTOM
         nCommand := WVGSB_BOTTOM
         IF nScrPos < ::range[ 2 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, ++nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_LINEUP
         nCommand := WVGSB_PREVPOS
         IF nScrPos > ::range[ 1 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, --nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_LINEDOWN
         nCommand := WVGSB_NEXTPOS
         IF nScrPos < ::range[ 2 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, ++nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_PAGEUP
         nCommand := WVGSB_PREVPAGE
         IF nScrPos > ::range[ 1 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, --nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_PAGEDOWN
         nCommand := WVGSB_NEXTPAGE
         IF nScrPos < ::range[ 2 ]
            wapi_SetScrollPos( ::pWnd, SB_CTL, ++nScrPos, .T. )
         ENDIF

      CASE nScrMsg == SB_THUMBPOSITION
         nCommand := WVGSB_SLIDERTRACK
         wapi_SetScrollPos( ::pWnd, SB_CTL, nScrPos, .T. )

      CASE nScrMsg == SB_THUMBTRACK
         nCommand := WVGSB_ENDTRACK
         wapi_SetScrollPos( ::pWnd, SB_CTL, nScrPos, .T. )

      CASE nScrMsg == SB_ENDSCROLL
         nCommand := WVGSB_ENDSCROLL
         wapi_SetScrollPos( ::pWnd, SB_CTL, nScrPos, .T. )

      ENDCASE

      ::sl_editBuffer := nScrPos
      Eval( ::sl_xbeSB_Scroll, { nScrPos, nCommand }, , Self )
      RETURN EVENT_HANDELLED

   ENDCASE

   RETURN EVENT_UNHANDELLED

METHOD PROCEDURE WvgScrollBar:destroy()

   ::wvgWindow:destroy()

   RETURN

METHOD WvgScrollBar:Scroll( xParam )

   IF HB_ISBLOCK( xParam )
      ::sl_xbeSB_Scroll := xParam
   ENDIF

   RETURN Self

METHOD WvgScrollBar:setRange( aRange )

   LOCAL aOldRange, nMin, nMax

   IF wapi_GetScrollRange( ::pWnd, SB_CTL, @nMin, @nMax )
      aOldRange := { nMin, nMax }
   ELSE
      aOldRange := ::range
   ENDIF

   IF wapi_SetScrollRange( ::pWnd, SB_CTL, aRange[ 1 ], aRange[ 2 ], .T. )
      ::range := aRange
   ENDIF

   RETURN aOldRange

METHOD WvgScrollBar:setScrollBoxSize( nUnits )
   RETURN nUnits


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Generate Harbour code for: Header file for contribution module 'hbtip' (Internet protocol utilities (FTP, HTTP, SMTP, POP3)): contrib/hbtip/thtml.ch. Defines 10 constants including: _HB_THTML, CM_UNKNOWN, CM_EMPTY, CM_HTML, CM_HEAD. Defines color and display constants

[Assistant]
#ifndef _HB_THTML
#define _HB_THTML

#define CM_UNKNOWN                  0
#define CM_EMPTY                    0x000001
#define CM_HTML                     0x000002
#define CM_HEAD                     0x000004
#define CM_BLOCK                    0x000008
#define CM_INLINE                   0x000010
#define CM_LIST                     0x000020
#define CM_DEFLIST                  0x000040
#define CM_TABLE                    0x000080
#define CM_ROWGRP                   0x000100
#define CM_ROW                      0x000200
#define CM_FIELD                    0x000400
#define CM_OBJECT                   0x000800
#define CM_PARAM                    0x001000
#define CM_FRAMES                   0x002000
#define CM_HEADING                  0x004000
#define CM_OPT                      0x008000
#define CM_IMG                      0x010000
#define CM_MIXED                    0x020000
#define CM_NO_INDENT                0x040000
#define CM_OBSOLETE                 0x080000
#define CM_NEW                      0x100000
#define CM_OMITST                   0x200000

#define HTML_ATTR_ABBR              1
#define HTML_ATTR_ACCEPT            2
#define HTML_ATTR_ACCEPT_CHARSET    3
#define HTML_ATTR_ACCESSKEY         4
#define HTML_ATTR_ACTION            5
#define HTML_ATTR_ADD_DATE          6
#define HTML_ATTR_ALIGN             7
#define HTML_ATTR_ALINK             8
#define HTML_ATTR_ALT               9
#define HTML_ATTR_ARCHIVE           10
#define HTML_ATTR_AXIS              11
#define HTML_ATTR_BACKGROUND        12
#define HTML_ATTR_BGCOLOR           13
#define HTML_ATTR_BGPROPERTIES      14
#define HTML_ATTR_BORDER            15
#define HTML_ATTR_BORDERCOLOR       16
#define HTML_ATTR_BOTTOMMARGIN      17
#define HTML_ATTR_CELLPADDING       18
#define HTML_ATTR_CELLSPACING       19
#define HTML_ATTR_CHAR              20
#define HTML_ATTR_CHAROFF           21
#define HTML_ATTR_CHARSET           22
#define HTML_ATTR_CHECKED           23
#define HTML_ATTR_CITE              24
#define HTML_ATTR_CLASS             25
#define HTML_ATTR_CLASSID           26
#define HTML_ATTR_CLEAR             27
#define HTML_ATTR_CODE              28
#define HTML_ATTR_CODEBASE          29
#define HTML_ATTR_CODETYPE          30
#define HTML_ATTR_COLOR             31
#define HTML_ATTR_COLS              32
#define HTML_ATTR_COLSPAN           33
#define HTML_ATTR_COMPACT           34
#define HTML_ATTR_CONTENT           35
#define HTML_ATTR_COORDS            36
#define HTML_ATTR_DATA              37
#define HTML_ATTR_DATAFLD           38
#define HTML_ATTR_DATAFORMATAS      39
#define HTML_ATTR_DATAPAGESIZE      40
#define HTML_ATTR_DATASRC           41
#define HTML_ATTR_DATETIME          42
#define HTML_ATTR_DECLARE           43
#define HTML_ATTR_DEFER             44
#define HTML_ATTR_DIR               45
#define HTML_ATTR_DISABLED          46
#define HTML_ATTR_ENCODING          47
#define HTML_ATTR_ENCTYPE           48
#define HTML_ATTR_EVENT             49
#define HTML_ATTR_FACE              50
#define HTML_ATTR_FOR               51
#define HTML_ATTR_FRAME             52
#define HTML_ATTR_FRAMEBORDER       53
#define HTML_ATTR_FRAMESPACING      54
#define HTML_ATTR_GRIDX             55
#define HTML_ATTR_GRIDY             56
#define HTML_ATTR_HEADERS           57
#define HTML_ATTR_HEIGHT            58
#define HTML_ATTR_HREF              59
#define HTML_ATTR_HREFLANG          60
#define HTML_ATTR_HSPACE            61
#define HTML_ATTR_HTTP_EQUIV        62
#define HTML_ATTR_ID                63
#define HTML_ATTR_ISMAP             64
#define HTML_ATTR_LABEL             65
#define HTML_ATTR_LANG              66
#define HTML_ATTR_LANGUAGE          67
#define HTML_ATTR_LAST_MODIFIED     68
#define HTML_ATTR_LAST_VISIT        69
#define HTML_ATTR_LEFTMARGIN        70
#define HTML_ATTR_LINK              71
#define HTML_ATTR_LONGDESC          72
#define HTML_ATTR_LOWSRC            73
#define HTML_ATTR_MARGINHEIGHT      74
#define HTML_ATTR_MARGINWIDTH       75
#define HTML_ATTR_MAXLENGTH         76
#define HTML_ATTR_MEDIA             77
#define HTML_ATTR_METHOD            78
#define HTML_ATTR_METHODS           79
#define HTML_ATTR_MULTIPLE          80
#define HTML_ATTR_N                 81
#define HTML_ATTR_NAME              82
#define HTML_ATTR_NOHREF            83
#define HTML_ATTR_NORESIZE          84
#define HTML_ATTR_NOSHADE           85
#define HTML_ATTR_NOWRAP            86
#define HTML_ATTR_OBJECT            87
#define HTML_ATTR_ONAFTERUPDATE     88
#define HTML_ATTR_ONBEFOREUNLOAD    89
#define HTML_ATTR_ONBEFOREUPDATE    90
#define HTML_ATTR_ONBLUR            91
#define HTML_ATTR_ONCHANGE          92
#define HTML_ATTR_ONCLICK           93
#define HTML_ATTR_ONDATAAVAILABLE   94
#define HTML_ATTR_ONDATASETCHANGED  95
#define HTML_ATTR_ONDATASETCOMPLETE 96
#define HTML_ATTR_ONDBLCLICK        97
#define HTML_ATTR_ONERRORUPDATE     98
#define HTML_ATTR_ONFOCUS           99
#define HTML_ATTR_ONKEYDOWN         100
#define HTML_ATTR_ONKEYPRESS        101
#define HTML_ATTR_ONKEYUP           102
#define HTML_ATTR_ONLOAD            103
#define HTML_ATTR_ONMOUSEDOWN       104
#define HTML_ATTR_ONMOUSEMOVE       105
#define HTML_ATTR_ONMOUSEOUT        106
#define HTML_ATTR_ONMOUSEOVER       107
#define HTML_ATTR_ONMOUSEUP         108
#define HTML_ATTR_ONRESET           109
#define HTML_ATTR_ONROWENTER        110
#define HTML_ATTR_ONROWEXIT         111
#define HTML_ATTR_ONSELECT          112
#define HTML_ATTR_ONSUBMIT          113
#define HTML_ATTR_ONUNLOAD          114
#define HTML_ATTR_PROFILE           115
#define HTML_ATTR_PROMPT            116
#define HTML_ATTR_RBSPAN            117
#define HTML_ATTR_READONLY          118
#define HTML_ATTR_REL               119
#define HTML_ATTR_REV               120
#define HTML_ATTR_RIGHTMARGIN       121
#define HTML_ATTR_ROWS              122
#define HTML_ATTR_ROWSPAN           123
#define HTML_ATTR_RULES             124
#define HTML_ATTR_SCHEME            125
#define HTML_ATTR_SCOPE             126
#define HTML_ATTR_SCROLLING         127
#define HTML_ATTR_SDAFORM           128
#define HTML_ATTR_SDAPREF           129
#define HTML_ATTR_SDASUFF           130
#define HTML_ATTR_SELECTED          131
#define HTML_ATTR_SHAPE             132
#define HTML_ATTR_SHOWGRID          133
#define HTML_ATTR_SHOWGRIDX         134
#define HTML_ATTR_SHOWGRIDY         135
#define HTML_ATTR_SIZE              136
#define HTML_ATTR_SPAN              137
#define HTML_ATTR_SRC               138
#define HTML_ATTR_STANDBY           139
#define HTML_ATTR_START             140
#define HTML_ATTR_STYLE             141
#define HTML_ATTR_SUMMARY           142
#define HTML_ATTR_TABINDEX          143
#define HTML_ATTR_TARGET            144
#define HTML_ATTR_TEXT              145
#define HTML_ATTR_TITLE             146
#define HTML_ATTR_TOPMARGIN         147
#define HTML_ATTR_TYPE              148
#define HTML_ATTR_UNKNOWN           149
#define HTML_ATTR_URN               150
#define HTML_ATTR_USEMAP            151
#define HTML_ATTR_VALIGN            152
#define HTML_ATTR_VALUE             153
#define HTML_ATTR_VALUETYPE         154
#define HTML_ATTR_VERSION           155
#define HTML_ATTR_VLINK             156
#define HTML_ATTR_VSPACE            157
#define HTML_ATTR_WIDTH             158
#define HTML_ATTR_WRAP              159
#define HTML_ATTR_XMLNS             160
#define HTML_ATTR_XML_LANG          161
#define HTML_ATTR_XML_SPACE         162

#define HTML_ATTR_COUNT             162

#define HTML_ATTR_TYPE_UNKNOWN      0
#define HTML_ATTR_TYPE_ACTION       1
#define HTML_ATTR_TYPE_ALIGN        2
#define HTML_ATTR_TYPE_BOOL         3
#define HTML_ATTR_TYPE_BORDER       4
#define HTML_ATTR_TYPE_CHARACTER    5
#define HTML_ATTR_TYPE_CHARSET      6
#define HTML_ATTR_TYPE_CLEAR        7
#define HTML_ATTR_TYPE_COLOR        8
#define HTML_ATTR_TYPE_COLS         9
#define HTML_ATTR_TYPE_COORDS       10
#define HTML_ATTR_TYPE_DATE         11


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Create Harbour preprocessor definitions: Header file for contribution module 'hbssl' (OpenSSL wrapper for SSL/TLS encryption): contrib/hbssl/hbssl.ch. Defines 10 constants including: HBSSL_CH_, HB_SSL_CTX_NEW_METHOD_UNKNOWN, HB_SSL_CTX_NEW_METHOD_DEFAULT, HB_SSL_CTX_NEW_METHOD_SSLV2, HB_SSL_CTX_NEW_METHOD_SSLV2_SERVER. Defines error handling constants and codes

[Assistant]
#ifndef HBSSL_CH_
#define HBSSL_CH_

#define HB_SSL_CTX_NEW_METHOD_UNKNOWN                       ( -2 )
#define HB_SSL_CTX_NEW_METHOD_DEFAULT                       ( -1 )
#define HB_SSL_CTX_NEW_METHOD_SSLV2                         0
#define HB_SSL_CTX_NEW_METHOD_SSLV2_SERVER                  1
#define HB_SSL_CTX_NEW_METHOD_SSLV2_CLIENT                  2
#define HB_SSL_CTX_NEW_METHOD_SSLV3                         3
#define HB_SSL_CTX_NEW_METHOD_SSLV3_SERVER                  4
#define HB_SSL_CTX_NEW_METHOD_SSLV3_CLIENT                  5
#define HB_SSL_CTX_NEW_METHOD_TLSV1                         6
#define HB_SSL_CTX_NEW_METHOD_TLSV1_SERVER                  7
#define HB_SSL_CTX_NEW_METHOD_TLSV1_CLIENT                  8
#define HB_SSL_CTX_NEW_METHOD_TLS                           9
#define HB_SSL_CTX_NEW_METHOD_TLS_SERVER                    10
#define HB_SSL_CTX_NEW_METHOD_TLS_CLIENT                    11
#define HB_SSL_CTX_NEW_METHOD_SSLV23                        HB_SSL_CTX_NEW_METHOD_TLS
#define HB_SSL_CTX_NEW_METHOD_SSLV23_SERVER                 HB_SSL_CTX_NEW_METHOD_TLS_SERVER
#define HB_SSL_CTX_NEW_METHOD_SSLV23_CLIENT                 HB_SSL_CTX_NEW_METHOD_TLS_CLIENT

#define HB_OPENSSL_VERSION                                  0
#define HB_OPENSSL_CFLAGS                                   1
#define HB_OPENSSL_BUILT_ON                                 2
#define HB_OPENSSL_PLATFORM                                 3
#define HB_OPENSSL_DIR                                      4

#define HB_SSLEAY_VERSION                                   HB_OPENSSL_VERSION
#define HB_SSLEAY_CFLAGS                                    HB_OPENSSL_CFLAGS
#define HB_SSLEAY_BUILT_ON                                  HB_OPENSSL_BUILT_ON
#define HB_SSLEAY_PLATFORM                                  HB_OPENSSL_PLATFORM
#define HB_SSLEAY_DIR                                       HB_OPENSSL_DIR

#define HB_SSL_ERROR_NONE                                   0
#define HB_SSL_ERROR_SSL                                    1
#define HB_SSL_ERROR_WANT_READ                              2
#define HB_SSL_ERROR_WANT_WRITE                             3
#define HB_SSL_ERROR_WANT_X509_LOOKUP                       4
#define HB_SSL_ERROR_SYSCALL                                5
#define HB_SSL_ERROR_ZERO_RETURN                            6
#define HB_SSL_ERROR_WANT_CONNECT                           7
#define HB_SSL_ERROR_WANT_ACCEPT                            8

#define HB_SSL_SOCK_ERROR_BASE                              100

#define HB_SSL_OP_MICROSOFT_SESS_ID_BUG                     0x00000001
#define HB_SSL_OP_NETSCAPE_CHALLENGE_BUG                    0x00000002
#define HB_SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG          0x00000008
#define HB_SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG               0x00000010
#define HB_SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER                0x00000020
#define HB_SSL_OP_MSIE_SSLV2_RSA_PADDING                    0x00000040
#define HB_SSL_OP_SSLEAY_080_CLIENT_DH_BUG                  0x00000080
#define HB_SSL_OP_TLS_D5_BUG                                0x00000100
#define HB_SSL_OP_TLS_BLOCK_PADDING_BUG                     0x00000200
#define HB_SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS               0x00000800
#define HB_SSL_OP_ALL                                       0x00000FFF
#define HB_SSL_OP_NO_QUERY_MTU                              0x00001000
#define HB_SSL_OP_COOKIE_EXCHANGE                           0x00002000
#define HB_SSL_OP_NO_TICKET                                 0x00004000
#define HB_SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION    0x00010000
#define HB_SSL_OP_SINGLE_ECDH_USE                           0x00080000
#define HB_SSL_OP_SINGLE_DH_USE                             0x00100000
#define HB_SSL_OP_EPHEMERAL_RSA                             0x00200000
#define HB_SSL_OP_CIPHER_SERVER_PREFERENCE                  0x00400000
#define HB_SSL_OP_TLS_ROLLBACK_BUG                          0x00800000
#define HB_SSL_OP_NO_SSLv2                                  0x01000000
#define HB_SSL_OP_NO_SSLv3                                  0x02000000
#define HB_SSL_OP_NO_TLSv1                                  0x04000000
#define HB_SSL_OP_NO_TLSv1_2                                0x08000000
#define HB_SSL_OP_NO_TLSv1_1                                0x10000000
#define HB_SSL_OP_PKCS1_CHECK_1                             0x08000000
#define HB_SSL_OP_PKCS1_CHECK_2                             0x10000000
#define HB_SSL_OP_NETSCAPE_CA_DN_BUG                        0x20000000
#define HB_SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG           0x40000000

#define HB_SSL_MODE_ENABLE_PARTIAL_WRITE                    1
#define HB_SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER              2
#define HB_SSL_MODE_AUTO_RETRY                              4
#define HB_SSL_MODE_NO_AUTO_CHAIN                           8

#define HB_SSL_SENT_SHUTDOWN                                1
#define HB_SSL_RECEIVED_SHUTDOWN                            2

#define HB_SSL_FILETYPE_PEM                                 1
#define HB_SSL_FILETYPE_ASN1                                2

#define HB_BIO_NOCLOSE                                      0x00
#define HB_BIO_CLOSE                                        0x01

#define HB_X509_V_OK                                        0
#define HB_X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT             2
#define HB_X509_V_ERR_UNABLE_TO_GET_CRL                     3
#define HB_X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE      4
#define HB_X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE       5
#define HB_X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY    6
#define HB_X509_V_ERR_CERT_SIGNATURE_FAILURE                7
#define HB_X509_V_ERR_CRL_SIGNATURE_FAILURE                 8
#define HB_X509_V_ERR_CERT_NOT_YET_VALID                    9
#define HB_X509_V_ERR_CERT_HAS_EXPIRED                      10
#define HB_X509_V_ERR_CRL_NOT_YET_VALID                     11
#define HB_X509_V_ERR_CRL_HAS_EXPIRED                       12
#define HB_X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD        13
#define HB_X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD         14
#define HB_X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD        15
#define HB_X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD        16
#define HB_X509_V_ERR_OUT_OF_MEM                            17
#define HB_X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT           18
#define HB_X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN             19
#define HB_X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY     20
#define HB_X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE       21
#define HB_X509_V_ERR_CERT_CHAIN_TOO_LONG                   22
#define HB_X509_V_ERR_CERT_REVOKED                          23
#define HB_X509_V_ERR_INVALID_CA                            24
#define HB_X509_V_ERR_PATH_LENGTH_EXCEEDED                  25
#define HB_X509_V_ERR_INVALID_PURPOSE                       26
#define HB_X509_V_ERR_CERT_UNTRUSTED                        27
#define HB_X509_V_ERR_CERT_REJECTED                         28
#define HB_X509_V_ERR_SUBJECT_ISSUER_MISMATCH               29
#define HB_X509_V_ERR_AKID_SKID_MISMATCH                    30
#define HB_X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH           31
#define HB_X509_V_ERR_KEYUSAGE_NO_CERTSIGN                  32
#define HB_X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER              33
#define HB_X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION          34
#define HB_X509_V_ERR_KEYUSAGE_NO_CRL_SIGN                  35
#define HB_X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION      36
#define HB_X509_V_ERR_INVALID_NON_CA                        37
#define HB_X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED            38
#define HB_X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE         39
#define HB_X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED        40
#define HB_X509_V_ERR_INVALID_EXTENSION                     41
#define HB_X509_V_ERR_INVALID_POLICY_EXTENSION              42
#define HB_X509_V_ERR_NO_EXPLICIT_POLICY                    43
#define HB_X509_V_ERR_UNNESTED_RESOURCE                     44


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Implement this Harbour module: Header file for contribution module 'xhb' (Extended Harbour functions): contrib/xhb/xhb.ch. Defines constants: XHB__CH_. Declares 2 preprocessor commands. Declares 5 preprocessor translations. Defines color and display constants

[Assistant]
#ifndef XHB__CH_
#define XHB__CH_

#include "hbcompat.ch"

#ifdef __HARBOUR__

#ifndef __XHARBOUR__
   #pragma -ks+
   #pragma -kd+
   REQUEST xhb_Lib

   #xtranslate __Keyboard( [<x,...>] )           => xhb__Keyboard( <x> )
   #xtranslate __CopyFile( [<x,...>] )           => xhb_CopyFile( <x> )

   #xuntranslate AIns(                           =>
   #xuntranslate ADel(                           =>

   #xtranslate AIns( <a>, <n>, [<x,...>] )       => xhb_AIns( <a>, <n>, <x> )
   #xtranslate ADel( <a>, <n>, <l> )             => xhb_ADel( <a>, <n>, <l> )

   #xuntranslate NetName(                        =>
   #xuntranslate MemoWrit(                       =>

   #xtranslate NetName( [<x,...>] )              => xhb_NetName( <x> )
   #xtranslate MemoWrit( [<x,...>] )             => xhb_MemoWrit( <x> )

   #xtranslate SaveScreen( [<x,...>] )           => xhb_SaveScreen( <x> )
   #xtranslate RestScreen( [<x,...>] )           => xhb_RestScreen( <x> )
   #xtranslate RTrim( [<x,...>] )                => xhb_RTrim( <x> )
   #xtranslate Trim( [<x,...>] )                 => xhb_Trim( <x> )
   #xtranslate AllTrim( [<x,...>] )              => xhb_AllTrim( <x> )

   #command SET TRACE <x:ON,OFF,&>               => xhb_SetTrace( <(x)> )
   #command SET TRACE (<x>)                      => xhb_SetTrace( <x> )
   #xtranslate Set( _SET_TRACE [,<x,...>] )      => xhb_SetTrace( <x> )
   #xtranslate Set( _SET_TRACEFILE [,<x,...>] )  => xhb_SetTraceFile( <x> )
   #xtranslate Set( _SET_TRACESTACK [,<x,...>] ) => xhb_SetTraceStack( <x> )

#endif

#endif

#endif


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Write a Harbour program with procedures: Main. Harbour contribution module 'hbct' (CA-Tools compatibility library): contrib/hbct/tests/token.prg. Contains procedures: Main. This file provides legacy compatibility functions

[Assistant]
#ifdef __HARBOUR__
#require "hbct"
#else
#define hb_ntos( n ) LTrim( Str( n ) )
#endif

PROCEDURE Main()

   LOCAL cStr := ".,.This.,.is.,.a.,.test!"
   LOCAL ni, npos
   LOCAL cPre := " "
   LOCAL cPost := " "

   ctinit()

   ? "Begin test of Token()"
   ?

   ? "  Simple tests:"
   ? '    Token( "Hello, World!" )            == "World" ? ---> "' + Token( "Hello, World!" ) + '"'
   ? '    Token( "Hello, World!",, 2, 1 )     == "" ? --------> "' + Token( "Hello, World!",, 2, 1 ) + '"'
   ? '    Token( "Hello, World!", ",", 2, 1 ) == " World!" ? -> "' + Token( "Hello, World!", ",", 2, 1 ) + '"'
   ? '    Token( "Hello, World!", " ", 2, 1 ) == "World!" ? --> "' + Token( "Hello, World!", " ", 2, 1 ) + '"'
   ?

   ? '  Tokenizing the string "' + cStr + '"'
   ? '    with skip width == 1 and ".,!" as tokenizer list:'
   ?
   FOR ni := 1 TO NumToken( cStr, ".,!", 1 )
      ? '    Token #' + hb_ntos( ni ) + '("' + Token( cStr, ".,!", ni, 1, @cPre, @cPost ) + ;
         '") @ pos ' + Str( npos := AtToken( cStr, ".,!", ni, 1 ), 3 ) + ', tokenized by "' + cPre + '" and "' + cPost + '" is ' + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty"
   NEXT

   ?
   ? '  Tokenizing the string "' + cStr + '"'
   ? '    with skip width == 3 and ".,!" as tokenizer list:'
   ?
   FOR ni := 1 TO NumToken( cStr, ".,!", 3 )
      ? '    Token #' + hb_ntos( ni ) + '("' + Token( cStr, ".,!", ni, 3, @cPre, @cPost ) + ;
         '") @ pos ' + Str( npos := AtToken( cStr, ".,!", ni, 3 ), 3 ) + ', tokenized by "' + cPre + '" and "' + cPost + '" is ' + iif( SubStr( cStr, npos, 1 ) $ ".,!", "", "not " ) + "empty."
   NEXT

   ?
   ? "End test of Token()"
   ?

   ctexit()

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User]
Here is a Harbour (xBase/Clipper) implementation:

Harbour contribution module 'hbcairo' (Cairo graphics library wrapper): contrib/hbcairo/tests/glyphdbg.prg. Contains procedures: Main, path_debug. This file provides graphics and image processing capabilities

[Assistant]
#require "hbcairo"

PROCEDURE Main()

   LOCAL hSurface, hCairo

   hSurface := cairo_pdf_surface_create( "glyphdbg.pdf", 566.9, 793.7 )
   hCairo := cairo_create( hSurface )

   cairo_select_font_face( hCairo, "Times", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL )
   cairo_set_font_size( hCairo, 200 )
   cairo_set_source_rgb( hCairo, 0, 0, 0.7 )

   cairo_move_to( hCairo, 100, 250 )
   cairo_text_path( hCairo, "Ag" )
   path_debug( hCairo )

   cairo_move_to( hCairo, 100, 500 )
   cairo_text_path( hCairo, "Ag" )
   path_debug( hCairo, 4 )

   cairo_show_page( hCairo )
   cairo_destroy( hCairo )
   cairo_surface_destroy( hSurface )

   RETURN

PROCEDURE path_debug( hCairo, nTolerance )

   LOCAL hPath, hIterator, nType, aPoints

   cairo_save( hCairo )

   IF Empty( nTolerance )
      hPath := cairo_copy_path( hCairo )
   ELSE
      cairo_save( hCairo )
      cairo_set_tolerance( hCairo, nTolerance )
      hPath := cairo_copy_path_flat( hCairo )
      cairo_restore( hCairo )
   ENDIF

   cairo_new_path( hCairo )
   cairo_append_path( hCairo, hPath )
   cairo_set_source_rgb( hCairo, 0, 0.4, 0 )
   cairo_set_line_width( hCairo, 1.0 )
   cairo_stroke( hCairo )

   cairo_set_source_rgb( hCairo, 0, 0, 0 )
   cairo_set_line_width( hCairo, 2.0 )
   cairo_set_line_cap( hCairo, CAIRO_LINE_CAP_ROUND )
   hIterator := cairo_path_iterator_create( hPath )
   DO WHILE ( nType := cairo_path_iterator_next( hIterator ) ) != NIL
      aPoints := cairo_path_iterator_get_points( hIterator )
      IF nType == CAIRO_PATH_MOVE_TO
         cairo_move_to( hCairo, aPoints[ 1, 1 ], aPoints[ 1, 2 ] )
         cairo_rel_line_to( hCairo, 0, 0 )
      ELSEIF nType == CAIRO_PATH_LINE_TO
         cairo_move_to( hCairo, aPoints[ 1, 1 ], aPoints[ 1, 2 ] )
         cairo_rel_line_to( hCairo, 0, 0 )
      ELSEIF nType == CAIRO_PATH_CURVE_TO
         cairo_stroke( hCairo )
         cairo_set_source_rgb( hCairo, 0.5, 0.5, 0.5 )
         cairo_move_to( hCairo, aPoints[ 1, 1 ], aPoints[ 1, 2 ] )
         cairo_rel_line_to( hCairo, 0, 0 )
         cairo_move_to( hCairo, aPoints[ 2, 1 ], aPoints[ 2, 2 ] )
         cairo_rel_line_to( hCairo, 0, 0 )
         cairo_stroke( hCairo )
         cairo_set_source_rgb( hCairo, 0, 0, 0 )
         cairo_move_to( hCairo, aPoints[ 3, 1 ], aPoints[ 3, 2 ] )
         cairo_rel_line_to( hCairo, 0, 0 )
      ENDIF
   ENDDO
   cairo_path_iterator_destroy( hIterator )
   cairo_stroke( hCairo )
   cairo_path_destroy( hPath )
   cairo_restore( hCairo )

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User]
Write the following Harbour (xBase/Clipper) code:

Harbour header file: include/hbextcdp.ch. Defines constants: HB_EXTCDP_CH_, __HBEXTERN__HBCPAGE__REQUEST. Defines Harbour internal constants and macros

[Assistant]
#ifndef HB_EXTCDP_CH_
#define HB_EXTCDP_CH_

#define __HBEXTERN__HBCPAGE__REQUEST
#include "hbcpage.hbx"

#endif


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Write a Harbour program with procedures: Main. Harbour contribution module 'hbnf' (NanForum Toolkit - legacy Clipper compatibility functions): contrib/hbnf/tests/mouse1.prg. Contains procedures: Main. This file provides legacy compatibility functions

[Assistant]
#require "hbnf"

#ifndef __HARBOUR__
#define hb_ntos( n ) LTrim( Str( n ) )
#endif

PROCEDURE Main( nRow, nCol )

   LOCAL nX, nY, cSavClr
   LOCAL cSavScr := SaveScreen( 0, 0, MaxRow(), MaxCol() )
   LOCAL nSaveRow := MaxRow() + 1, nSaveCol := MaxCol() + 1
   LOCAL nMinor, nType, nIRQ
   LOCAL aType := { "Bus", "Serial", "InPort", "PS/2", "HP" }
   LOCAL nHoriz, nVert, nDouble

   IF nRow == NIL
      nRow := MaxRow() + 1
   ELSE
      nRow := Val( nRow )
   ENDIF

   IF nCol == NIL
      nCol := MaxCol() + 1
   ELSE
      nCol := Val( nCol )
   ENDIF

   IF ! SetMode( nRow, nCol )
      @ MaxRow(), 0 SAY "Mode Change unsuccessful:" + Str( nRow, 2, 0 ) + " by";
         + Str( nCol, 3, 0 )
      RETURN
   ENDIF

   IF Empty( ft_MInit() )
      @ MaxRow(), 0 SAY "Mouse driver is not installed!"
      SetMode( nSaveRow, nSaveCol )
      RETURN
   ENDIF

   SET CURSOR OFF

   cSavClr := SetColor( "w/n" )
   @ 0, 0, MaxRow(), MaxCol() BOX hb_UTF8ToStr( "░░░░░░░░░" )

   SetColor( "GR+/RB" )
   Scroll( 7, 2, 19, 63, 0 )
   @ 7, 2 TO 20, 63

   @ 17, 10 TO 19, 40 double

   SetColor( "N/W" )
   @ 18, 11 SAY "  Double Click here to Quit  "

   SetColor( "GR+/RB" )

   @ MaxRow(), 0 SAY "Driver version: " + ;
      hb_ntos( ft_MVersion( @nMinor, @nType, @nIRQ ) ) + "." + ;
      hb_ntos( nMinor )
   @ Row(), Col() SAY " " + aType[ nType ] + " mouse using IRQ " + Str( nIRQ, 1, 0 )

   ft_MGetSens( @nHoriz, @nVert, @nDouble )
   ft_MSetSens( 70, 70, 60 )

   ft_MShowCrs()
   ft_MSetCoord( 10, 20 )

   DevPos( 9, 10 )
   DevOut( "FT_MMICKEYS :" )

   DevPos( 10, 10 )
   DevOut( "FT_MGETPOS  :" )

   DevPos( 11, 10 )
   DevOut( "FT_MGETX    :" )

   DevPos( 12, 10 )
   DevOut( "FT_MGETY    :" )

   DevPos( 13, 10 )
   DevOut( "FT_MGETCOORD:" )

   DevPos( 14, 10 )
   DevOut( "FT_MBUTPRS  :" )

   DevPos( 16, 10 )
   DevOut( "FT_MBUTREL  :" )

   nX := nY := 1
   DO WHILE .T.

      DO WHILE nX == 0 .AND. nY == 0
         ft_MMickeys( @nX, @nY )
      ENDDO

      ft_MCOnOff( 9, 23, 16, 53 )

      DevPos( 9, 23 )
      DevOut( nX )
      DevOut( nY )

      DevPos( 10, 23 )
      DevOut( ft_MGetPos( @nX, @nY ) )
      DevOut( nX )
      DevOut( nY )

      DevPos( 11, 23 )
      DevOut( ft_MGetX() )

      DevPos( 12, 23 )
      DevOut( ft_MGetY() )

      DevPos( 13, 23 )
      DevOut( ft_MGetCoord( @nX, @nY ) )
      DevOut( nX )
      DevOut( nY )

      nX := nY := 0
      DevPos( 14, 23 )
      DevOut( ft_MButPrs( 1 ) )
      DevOut( ft_MButPrs( 0,, nX, nY ) )
      DevPos( 15, 23 )

      IF nX != 0 .OR. nY != 0
         DevOut( nX )
         DevOut( nY )
      ENDIF

      nX := nY := 0
      DevPos( 16, 23 )
      DevOut( ft_MButRel( 0,, @nX, @nY ) )

      IF nX != 0 .OR. nY != 0
         DevOut( nX )
         DevOut( nY )
      ENDIF

      ft_MShowCrs()

      IF ft_MInRegion( 18, 11, 18, 39 )

         ft_MDefCrs( 0, 32767, 32512 )
         IF ft_MDblClk( 2, 0, 0.8 )
            EXIT
         ENDIF
      ENDIF

      IF ft_MInRegion( 18, 11, 18, 39 )

         ft_MDefCrs( 0, 32767, 32512 )
      ELSE

         ft_MDefCrs( 0, 30719, 30464 )
      ENDIF

      ft_MMickeys( @nX, @nY )
   ENDDO

   ft_MHideCrs()

   SetMode( nSaveRow, nSaveCol )
   SetColor( cSavClr )
   RestScreen( 0, 0, MaxRow(), MaxCol(), cSavScr )
   DevPos( MaxRow(), 0 )

   ft_MSetSens( nHoriz, nVert, nDouble )

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User]
Write the following Harbour (xBase/Clipper) code:

Header file for contribution module 'xhb' (Extended Harbour functions): contrib/xhb/htmlform.ch. Declares 4 preprocessor commands. Defines color and display constants

[Assistant]
#ifndef _FORMS_CH

#xcommand DEFINE FORM <oFrm>                                       ;
          [NAME <name>]                                            ;
          [METHOD <method>]                                        ;
          [ACTION <action>]                                        ;
          [ENCTYPE <enctype>]                                      ;
          [TARGET <target>]                                        ;
          [ONSUBMIT <onsubmit>]                                    ;
          [ONRESET <onreset>]                                      ;
          [<frame:FRAME>]                                          ;
          [CAPTION <cap>]                                          ;
          [CAPCOLOR <capclr>]                                      ;
          [CAPFONTCOLOR <capfntclr>]                               ;
          [CAPIMAGE <capimage>]                                    ;
          [BGIMAGE <bgimg>]                                        ;
          [FONTCOLOR <fntclr>]                                     ;
          [COLOR <clr>]                                            ;
          [WIDTH <w>]                                              ;
          =>                                                       ;
          <oFrm> := THtmlForm():New( [<name>], [<action>], [<method>],  ;
                                <.frame.>, <cap> )                ;;
          [<oFrm>:setTarget( <(target)> ) ;]                       ;
          [<oFrm>:setEncType( <(enctype)> ) ;]                     ;
          [<oFrm>:setCapClr( <(capclr)> ) ;]                       ;
          [<oFrm>:setCapFntClr( <(capfntclr)> ) ;]                 ;
          [<oFrm>:setCapImage( <(capimage)> ) ;]                   ;
          [<oFrm>:setBgImage( <(bgimg)> ) ;]                       ;
          [<oFrm>:setFontColor( <(fntclr)> ) ;]                    ;
          [<oFrm>:setFrmColor( <(clr)> ) ;]                        ;
          [<oFrm>:setwidth( <w> ) ;]                               ;
          [<oFrm>:setAction( <(action)> ) ;]                       ;
          [<oFrm>:setOnSubmit( <(onsubmit)> ) ;]                   ;
          [<oFrm>:setOnReset( <(onreset)> ) ]

#xcommand ACTIVATE <oFrm> ;
          =>;
          <oFrm>:Put( .T. ) ; <oFrm>:End()

#xcommand CONTROL ;
          [OF <obj>];
          [<typ:EDIT,TEXT,TEXTAREA,PASSWORD,BUTTON,IMAGE,CHECKBOX,CHECK,HIDDEN,RADIO,FILE,RESET,SUBMIT,SELECT,LISTBOX>] ;
          [ALIGN <aln:LEFT,RIGHT,CENTER,MIDDLE,TOP,TEXTTOP,BOTTOM,ABSMIDDLE,ABSCENTER,ABSBOTTOM,BASELINE>];
          [WRAP <wrap:OFF,VIRTUAL,PHYSICAL,NORMAL>] ;
          [NAME <name>]                       ;
          [VALUE <value>]                     ;
          [SIZE <size>]                       ;
          [MAXCHARS <maxchars>]               ;
          [ROWS <rows>]                       ;
          [COLS <cols>]                       ;
          [ONCHANGE <onchange>]               ;
          [ONSELECT <onselect>]               ;
          [ONFOCUS <onfocus>]                 ;
          [ONBLUR <onblur>]                   ;
          [ONCLICK <onclick>]                 ;
          [ONMOUSEOVER <onmsover>]            ;
          [ONMOUSEOUT <onmsout>]              ;
          [ONMOUSEUP <onmsup>]                ;
          [ONMOUSEDOWN <onmsdn>]              ;
          [ONKEYDOWN <onkdown>]               ;
          [ONKEYUP <onkup>]                   ;
          [ONKEYPRESS <onkprs>]               ;
          [PICTURE <pic>]                     ;
          [<chk:CHECKED>]                     ;
          [<dis:DISABLED>]                    ;
          [<ro:READONLY>]                     ;
          [<mult:MULTIPLE>]                   ;
          [CAPTION <cap>]                     ;
          [STYLE <style>]                     ;
          [ID <id>]                           ;
          [<l:LABEL>]                         ;
          IN <oForm>                          ;
          =>                                  ;
          <oForm>:addControl( ;
                  [ <obj>:= ] THtmlControl():SetControl(;
                  <(name)>, <rows>, <cols>, <size>, <maxchars>, ;
                  <(value)>, ;
                  <(onfocus)>, <(onblur)>, <(onchange)>, <(onselect)>, ;
                  <(onclick)>, <(onmsover)>, <(onmsout)>, <(onmsdn)>, <(onmsup)>, ;
                  <(onkdown)>, <(onkup)>, <(onkprs)>, ;
                  <(pic)>, <(cap)>, ;
                  <.dis.>, <.ro.>, <.mult.>, <.chk.>, ;
                  __ALIGN__ [<aln>], ;
                  __WRAP__ [<wrap>], ;
                  __TYPE__ [<typ>], ;
                  <style>, <id>, <.l.> ) )

#xcommand DEFINE <typ:EDIT,TEXT,TEXTAREA,PASSWORD,BUTTON,IMAGE,CHECKBOX,CHECK,HIDDEN,RADIO,FILE,RESET,SUBMIT,SELECT,LISTBOX> <oCtr>;
          [WRAP <wrap:OFF,VIRTUAL,PHYSICAL,NORMAL>] ;
          [ALIGN <aln:LEFT,RIGHT,CENTER,MIDDLE,TOP,TEXTTOP,BOTTOM,ABSMIDDLE,ABSCENTER,ABSBOTTOM,BASELINE>];
          [NAME <name>]                            ;
          [SIZE <size>]                            ;
          [MAXCHARS <maxchars>]                    ;
          [VALUE <value>]                          ;
          [ROWS <rows>]                            ;
          [COLS <cols>]                            ;
          [SOURCE <source>]                        ;
          [ONCHANGE <onchange>]                    ;
          [ONSELECT <onselect>]                    ;
          [ONFOCUS <onfocus>]                      ;
          [ONBLUR <onblur>]                        ;
          [ONCLICK <onclick>]                      ;
          [ONMOUSEOVER <onmsover>]                 ;
          [ONMOUSEOUT <onmsout>]                   ;
          [ONKEYDOWN <onkdown>]                    ;
          [ONKEYUP <onkup>]                        ;
          [ONKEYPRESS <onkprs>]                    ;
          [PICTURE <pic>]                          ;
          [<mult:MULTIPLE>]                        ;
          [<checked:CHECKED>]                      ;
          [<dis:DISABLED>]                         ;
          [<ro:READONLY>]                          ;
          [CAPTION <cap>]                          ;
          [STYLE <style>]                          ;
          [ID <id>]                                ;
          [<l:LABEL>]                              ;
          IN <oForm>                               ;
          =>                                       ;
          <oCtr> := THtmlControl()                 ;;
          [<oCtr>:SetName( <(name)> ) ;]           ;
          [<oCtr>:SetSize( <size> ) ;]             ;
          [<oCtr>:SetRows( <rows> ) ;]             ;
          [<oCtr>:SetCols( <cols> ) ;]             ;
          [<oCtr>:SetAlign( __ALIGN__ <aln> );]    ;
          [<oCtr>:SetWrap( __WRAP__ <wrap> );]     ;
          [<oCtr>:SetSource( <(source)> );]        ;
          [<oCtr>:SetMaxChars( <maxchars> );]      ;
          [<oCtr>:SetValue( <(value)> );]          ;
          [<oCtr>:SetOnFocus( <(onfocus)> );]      ;
          [<oCtr>:SetOnBlur( <(onblur)> );]        ;
          [<oCtr>:SetOnChange( <(onchange)> );]    ;
          [<oCtr>:SetOnSelect( <(onselect)> );]    ;
          [<oCtr>:SetonClick( <(onclick)> );]      ;
          [<oCtr>:SetonMsOver( <(onmsover)> );]    ;
          [<oCtr>:SetonMsOut( <(onmsout)> );]      ;
          [<oCtr>:SetonKDown( <(onkdown)> );]      ;
          [<oCtr>:SetonKUp( <(onkup)> );]          ;
          [<oCtr>:SetonKPress( <(onkprs)> );]      ;
          [<oCtr>:SetPicture( <(pic)> );]          ;
          [<oCtr>:SetCaption( <cap> );]            ;
          [<oCtr>:SetStyle( <(style)> );]          ;
          [<oCtr>:SetId( <(id)> );]                ;
          [<oCtr>:SetChecked( <.checked.> );]      ;
          [<oCtr>:SetMultiple( <.mult.> );]        ;
          [<oCtr>:SetDisabled( <.dis.> );]         ;
          [<oCtr>:SetReadonly( <.ro.> );]          ;
          [<oCtr>:SetLabel( <.l.> );]              ;


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Generate Harbour code for: Harbour contribution module 'gtwvw' (): contrib/gtwvw/tests/maincoor.prg. Contains procedures: Main, fillscreen. This file provides platform-specific functionality

[Assistant]
#require "gtwvw"

#include "inkey.ch"

PROCEDURE Main()

#if defined( __HBSCRIPT__HBSHELL ) .AND. defined( __PLATFORM__WINDOWS )
   hbshell_gtSelect( "GTWVW" )
#endif

   SetColor( "N/W" )

   wvw_SetMainCoord( .F. )
   fillscreen()

   wvw_SetMainCoord( .T. )
   fillscreen()

   RETURN

PROCEDURE fillscreen()

   LOCAL i, j

   hb_Scroll()
   wvw_nOpenWindow( "Win2", 10, 10, 19, 69 )
   wvw_nOpenWindow( "Win3", 15, 15, 22, 75 )
   DevPos( 0, 0 )
   ?? "I'm going to fill this (" + hb_ntos( MaxRow() + 1 ) + "x" + hb_ntos( MaxCol() + 1 ) + ") screen"
   DevPos( 1, 0 )
   FOR i := 1 TO MaxRow() - 1
      FOR j := 0 TO MaxCol()
         ?? hb_ntos( j % 10 )
      NEXT
   NEXT
   ?? "Done. Press ESC to exit."
   DO WHILE Inkey( 0 ) != K_ESC
   ENDDO
   wvw_lCloseWindow()
   wvw_lCloseWindow()

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Create Harbour preprocessor definitions: Harbour test program: tests/inkey.prg. Provides functions: TEST. Contains 10 procedures. This test file tests specific function APIs

[Assistant]
#include "inkey.ch"

#ifndef __HARBOUR__
#define hb_ntos( n ) LTrim( Str( n ) )
#endif

PROCEDURE Main( cSkip, cExt )

   AltD( 0 )

   IF Empty( cSkip )

      TEST1()
      NextTest()

      TEST2()
      NextTest()

      TEST3()
      NextTest()

      TEST4()
      NextTest()

      TEST5()
      NextTest()

      TEST6()
      NextTest()
   ENDIF

   TEST7( cSkip, cExt )
   ?

   RETURN

PROCEDURE Results()

   ? "Wait 2 seconds or press most any key to see the results of this test."
   Inkey( 2 )

   RETURN

PROCEDURE NextTest()

   ? "Press any key to continue on to the next test."
   Inkey( 0 )

   RETURN

FUNCTION TEST( cText )

   LOCAL cResult := ""

   Inkey( 2 )
   KEYBOARD cText
   DO WHILE NextKey() != 0
#ifdef __HARBOUR__
      cResult += hb_keyChar( Inkey() )
#else
      cResult += Chr( Inkey() )
#endif
   ENDDO

   RETURN "'" + cResult + "'"

PROCEDURE TEST1

   CLS
   ?
   ? "Testing the KEYBOARD and CLEAR TYPEAHEAD commands and the"
   ? "Inkey(), NextKey(), and LastKey() functions."
   ?
   ? "For the first test, the keyboard will be stuffed with the"
   ? "text 'AB' and then Inkey() will be called twice."
   ?
   ? "The result should be:   65   66"
   ?
   Results()
   ?
   KEYBOARD "AB"
   ? Inkey(), Inkey()
   ?

   RETURN

PROCEDURE TEST2

   CLS
   ?
   ? "For the second test, the keyboard will be stuffed with the"
   ? "text 'HELLO', then the typeahead will be cleared, and then"
   ? "Inkey() will be called once."
   ?
   ? "The result should be:   0"
   ?
   Results()
   ?
   KEYBOARD "HELLO"
   CLEAR TYPEAHEAD
   ? Inkey()
   ?

   RETURN

PROCEDURE TEST3

   CLS
   ?
   ? "For the third test, the keyboard will be stuffed with the"
   ? "text 'AB', then NextKey() will be called twice and finally"
   ? "Inkey() will be called twice."
   ?
   ? "The result should be:   65   65   65   66"
   ?
   Results()
   ?
   KEYBOARD "AB"
   ? NextKey(), NextKey(), Inkey(), Inkey()
   ?

   RETURN

PROCEDURE TEST4

   CLS
   ?
   ? "For the fourth test, the keyboard will be stuffed with the"
   ? "Text 'AB', then Inkey() will be called once, LastKey() will"
   ? "be called twice, NextKey() will be called once, and finally"
   ? "Inkey() will be called once."
   ?
   ? "The result should be:   65   65   65   66   66"
   ?
   Results()
   ?
   KEYBOARD "AB"
   ? Inkey(), LastKey(), LastKey(), NextKey(), Inkey()
   ?

   RETURN

PROCEDURE TEST5

   LOCAL cText

   CLS
   cText := "THIS IS A TEST. THIS IS ONLY A TEST. DO NOT PANIC!"
   ?? "For the fifth test, the keyboard will be stuffed with the"
   ? "Text '" + cText + "'"
   ? "with the typeahead buffer set to the default size, then 25"
   ? "then 16, then 0. After each attempt to stuff the buffer,"
   ? "the buffer will be emptied using NextKey() and Inkey() and"
   ? "the ASCII text that was extracted will be displayed."
   ?
   ? "For the default size, which is 50, all but '" + Right( cText, Len( cText ) - 49 ) + "' should be"
   ? "displayed. For size 25, '" + Left( cText, 24 ) + "' should"
   ? "be displayed. Size 16 should display '" + Left( cText, 15 ) + "',"
   ? "while size 0 should display ''."
   ?
   ? "Default TYPEAHEAD (50)"
   ? TEST( cText )
   ?

   ? "SET TYPEAHEAD TO 25"
   SET TYPEAHEAD TO 25
   ? TEST( cText )
   ?

   ? "SET TYPEAHEAD TO 16"
   SET TYPEAHEAD TO 16
   ? TEST( cText )
   ?

   ? "SET TYPEAHEAD TO 0"
   SET TYPEAHEAD TO 0
   ? TEST( cText )

   RETURN

PROCEDURE TEST6

   CLS
   ? "For the sixth test"
   ? "The typeahead is now being set to a value greater than the maximum,"
   ? "which is 4096 and is the value that will both be used and reported."
   ? "SET TYPEAHEAD TO 5000"
   ?
   SET TYPEAHEAD TO 5000
   ? Set( _SET_TYPEAHEAD )
   ?

   RETURN

PROCEDURE TEST7( cSkip, cExt )

   LOCAL nKey, nMask

   CLS
   ? "For the last test, a loop is started and all keyboard and mouse"
   ? "events are allowed. Each event will be displayed. Press the TAB"
   ? "key to exit. Try moving the mouse, holding and releasing the mouse"
   ? "buttons as well as double-clicking the mouse buttons."
   ?
   ? "Press any key."
   nMask := HB_INKEY_ALL

   IF ! Empty( cExt )
      IF "E" $ Upper( cExt )
         nMask += HB_INKEY_EXT
      ENDIF
   ENDIF

   Set( _SET_EVENTMASK, nMask )

   IF ! Empty( cSkip )
      IF Upper( cSkip ) == "BREAK"
         SetCancel( .T. )
         AltD( 1 )
         Tone( 440, 6 )
      ELSE
         SetCancel( .F. )
         AltD( 0 )
         Tone( 660, 6 )
      ENDIF
   ENDIF

   DO WHILE ( nKey := Inkey( 0, nMask ) ) != K_TAB
      DO CASE
      CASE nKey == K_MOUSEMOVE
         ? "The mouse moved."
      CASE nKey == K_LBUTTONDOWN
         ? "The left mouse button was pushed."
      CASE nKey == K_LBUTTONUP
         ? "The left mouse button was released."
      CASE nKey == K_RBUTTONDOWN
         ? "The right mouse button was pushed."
      CASE nKey == K_RBUTTONUP
         ? "The right mouse button was released."
      CASE nKey == K_LDBLCLK
         ? "The left mouse button was double-clicked."
      CASE nKey == K_RDBLCLK
         ? "The right mouse button was double-clicked."
      OTHERWISE
#ifdef __HARBOUR__
         ? "A keyboard key was pressed: ", nKey, hb_keyChar( nKey )
#else
         ? "A keyboard key was pressed: ", nKey, ;
            iif( nKey >= 32 .AND. nKey <= 255, Chr( nKey ), "" )
#endif
      ENDCASE

   ENDDO
   ? "The TAB key (" + hb_ntos( nKey ) + ") was pressed. Exiting..."

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Implement this Harbour module: Harbour contribution module 'hbblat' (Blat email sending utility): contrib/hbblat/tests/blatcmd.prg. Contains procedures: Main. This file provides utility functions

[Assistant]
#require "hbblat"

PROCEDURE Main()

   LOCAL cCmd := win_GetCommandLineParam()
   LOCAL nRet

   ? "Simple BLAT Command interface"
   ? "Paramenters: ", cCmd
   IF Empty( cCmd )
      ? "Try with -? option"
   ELSE
      ? "Sending parameters to blat"
      nRet := hb_blatSend( cCmd )
      ? nRet
   ENDIF

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Generate Harbour code for: Header file for contribution module 'xhb' (Extended Harbour functions): contrib/xhb/htmlclrs.ch. Defines 10 constants including: ALICEBLUE, ANTIQUEWHITE, AQUA, AQUAMARINE, AZURE. Defines color and display constants

[Assistant]
#ifndef _COLORS_CH

#define ALICEBLUE             "#A0CF00"
#define ANTIQUEWHITE          "#FFE8D0"
#define AQUA                  "#00FFFF"
#define AQUAMARINE            "#7FFFD0"
#define AZURE                 "#F0FFFF"
#define BEIGE                 "#F0F7DF"
#define BISQUE                "#FFE7C0"
#define BLACK                 "#000000"
#define BLANCHEDALMOND        "#FFE8CF"
#define BLUE                  "#0000FF"
#define BLUEVIOLET            "#8F28E0"
#define BROWN                 "#A0282F"
#define BURLYWOOD             "#DFB880"
#define CADETBLUE             "#5F9FA0"
#define CHARTREUSE            "#7FFF00"
#define CHOCOLATE             "#D0861F"
#define CORAL                 "#FF7F50"
#define CORNFLOWERBLUE        "#6097EF"
#define CORNSILK              "#FFF8DF"
#define CRIMSON               "#DF173F"
#define CYAN                  "#00FFFF"
#define DARKBLUE              "#00008F"
#define DARKCYAN              "#00888F"
#define DARKGOLDENROD         "#BF87F0"
#define DARKGRAY              "#AFA8AF"
#define DARKGREEN             "#006700"
#define DARKKHAKI             "#BFB76F"
#define DARKMAGENTA           "#8F008F"
#define DARKOLIVEGREEN        "#50682F"
#define DARKORANGE            "#FF8F00"
#define DARKORCHID            "#9F30CF"
#define DARKRED               "#8F0000"
#define DARKSALMON            "#EF977F"
#define DARKSEAGREEN          "#8FBF8F"
#define DARKSLATEBLUE         "#4F3F8F"
#define DARKSLATEGRAY         "#2F4F4F"
#define DARKTURQUOISE         "#00CFD0"
#define DARKVIOLET            "#9000D0"
#define DEEPPINK              "#FF1790"
#define DEEPSKYBLUE           "#00BFFF"
#define DIMGRAY               "#6F686F"
#define DODGERBLUE            "#1F90FF"
#define FIREBRICK             "#B02020"
#define FLORALWHITE           "#FFF8F0"
#define FORESTGREEN           "#208820"
#define FUCHSIA               "#FF00FF"
#define GAINSBORO             "#DFDFDF"
#define GHOSTWHITE            "#FFF8FF"
#define GOLD                  "#FFD700"
#define GOLDENROD             "#DFA720"
#define GRAY                  "#808080"
#define GREEN                 "#008000"
#define GREENYELLOW           "#AFFF2F"
#define HONEYDEW              "#F0FFF0"
#define HOTPINK               "#FF68B0"
#define INDIANRED             "#CF5F5F"
#define INDIGO                "#4F0080"
#define IVORY                 "#FFFFF0"
#define KHAKI                 "#F0E78F"
#define LAVENDER              "#E0E7FF"
#define LAVENDERBLUSH         "#FFF0F0"
#define LAWNGREEN             "#7FFF00"
#define LEMONCHIFFON          "#FFF8CF"
#define LIGHTBLUE             "#AFD8E0"
#define LIGHTCORAL            "#F08080"
#define LIGHTCYAN             "#E0FFFF"
#define LIGHTGOLDENRODYELLOW  "#FFF8D0"
#define LIGHTGREEN            "#90EF90"
#define LIGHTGREY             "#D0D0D0"
#define LIGHTPINK             "#FFB7C0"
#define LIGHTSALMON           "#FFA07F"
#define LIGHTSEAGREEN         "#20B0AF"
#define LIGHTSKYBLUE          "#80CFFF"
#define LIGHTSLATEGRAY        "#70889F"
#define LIGHTSTEELBLUE        "#B0C7DF"
#define LIGHTYELLOW           "#FFFFE0"
#define LIME                  "#00FF00"
#define LIMEGREEN             "#30CF30"
#define LINEN                 "#FFF0E0"
#define MAGENTA               "#FF00FF"
#define MAROON                "#800000"
#define MEDIUMAQUAMARINE      "#60CFAF"
#define MEDIUMBLUE            "#0000CF"
#define MEDIUMORCHID          "#BF57D0"
#define MEDIUMPURPLE          "#9070DF"
#define MEDIUMSEAGREEN        "#3FB070"
#define MEDIUMSLATEBLUE       "#7F68EF"
#define MEDIUMSPRINGGREEN     "#00F89F"
#define MEDIUMTURQUOISE       "#4FD0CF"
#define MEDIUMVIOLETRED       "#C01780"
#define MIDNIGHTBLUE          "#1F1870"
#define MINTCREAM             "#F0FFFF"
#define MISTYROSE             "#FFE7E0"
#define MOCCASIN              "#FFE7B0"
#define NAVAJOWHITE           "#FFDFAF"
#define NAVY                  "#000080"
#define OLDLACE               "#FFF7E0"
#define OLIVE                 "#808000"
#define OLIVEDRAB             "#6F8F20"
#define ORANGE                "#FFA700"
#define ORANGERED             "#FF4700"
#define ORCHID                "#DF70D0"
#define PALEGOLDENROD         "#EFE8AF"
#define PALEGREEN             "#9FF89F"
#define PALETURQUOISE         "#AFEFEF"
#define PALEVIOLETRED         "#DF7090"
#define PAPAYAWHIP            "#FFEFD0"
#define PEACHPUFF             "#FFD8BF"
#define PERU                  "#CF873F"
#define PINK                  "#FFC0CF"
#define PLUM                  "#DFA1DF"
#define POWDERBLUE            "#B0E0E0"
#define PURPLE                "#800080"
#define RED                   "#FF0000"
#define ROSYBROWN             "#BF8F8F"
#define ROYALBLUE             "#4068E0"
#define SADDLEBROWN           "#8F4710"
#define SALMON                "#FF8070"
#define SANDYBROWN            "#F0A760"
#define SEAGREEN              "#2F8850"
#define SEASHELL              "#FFF7EF"
#define SIENNA                "#A0502F"
#define SILVER                "#C0C0C0"
#define SKYBLUE               "#80CFEF"
#define SLATEBLUE             "#6F58CF"
#define SLATEGRAY             "#708090"
#define SNOW                  "#FFF8FF"
#define SPRINGGREEN           "#00FF7F"
#define STEELBLUE             "#4080B0"
#define TAN                   "#D0B78F"
#define TEAL                  "#008080"
#define THISTLE               "#DFBFDF"
#define TOMATO                "#FF6040"
#define TURQUOISE             "#40E0D0"
#define VIOLET                "#EF80EF"
#define WHEAT                 "#F0DFB0"
#define WHITE                 "#FFFFFF"
#define WHITESMOKE            "#F0F7F0"
#define YELLOW                "#FFFF00"
#define YELLOWGREEN           "#9FCF30"

#define _COLORS_CH
#endif


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User]
Here is a Harbour (xBase/Clipper) implementation:

Harbour test program: tests/achoice5.prg. Contains procedures: Main. This test file tests specific function APIs

[Assistant]
#include "inkey.ch"

PROCEDURE Main()

   LOCAL nb

   CLS
   nb := 20
   DispBox( 4, 9, nb + 1, 51,, "W+/B,N/BG" )
   AChoice( 5, 10, nb, 50, ;
      { "menu 1", "menu 2", "menu 3", "menu 4", "menu 5", "menu 6", "menu 7", "menu 8", "menu 9", "menu 10" }, ;
      { .T., .T., .T., .T., .F., .F., .F., .T., .F., .F. } )

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Implement these Harbour functions: Harbour contribution module 'rddmisc' (): contrib/rddmisc/vfpcdx.prg. Provides functions: VFPCDX_GETFUNCTABLE. Contains procedures: VFPCDX_INIT. This file handles database operations

[Assistant]
#include "dbinfo.ch"
#include "hbusrrdd.ch"
#include "rddsys.ch"

REQUEST DBFCDX
REQUEST DBFFPT

ANNOUNCE VFPCDX

FUNCTION VFPCDX_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, pSuperRddID )
   RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, "DBFCDX", {}, pSuperRddID )

INIT PROCEDURE VFPCDX_INIT()

   rddRegister( "VFPCDX", RDT_FULL )

   rddInfo( RDDI_TABLETYPE, DB_DBF_VFP, "VFPCDX" )
   rddInfo( RDDI_MEMOTYPE, DB_MEMO_FPT, "VFPCDX" )
   rddInfo( RDDI_MEMOVERSION, DB_MEMOVER_STD, "VFPCDX" )
   rddInfo( RDDI_LOCKSCHEME, DB_DBFLOCK_VFP, "VFPCDX" )

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Generate Harbour code for: Harbour Runtime Library file: src/rtl/langlgcy.prg. Contains 52 procedures. This file provides utility functions

[Assistant]
#ifdef HB_LEGACY_LEVEL4

#include "hbextcdp.ch"
#include "hbextlng.ch"

PROCEDURE HB_LANG_BE866() ; RETURN
PROCEDURE HB_LANG_BEWIN() ; RETURN
PROCEDURE HB_LANG_BG866() ; RETURN
PROCEDURE HB_LANG_BGISO() ; RETURN
PROCEDURE HB_LANG_BGMIK() ; RETURN
PROCEDURE HB_LANG_BGWIN() ; RETURN
PROCEDURE HB_LANG_CS852() ; RETURN
PROCEDURE HB_LANG_CSISO() ; RETURN
PROCEDURE HB_LANG_CSKAM() ; RETURN
PROCEDURE HB_LANG_CSWIN() ; RETURN
PROCEDURE HB_LANG_DEWIN() ; RETURN
PROCEDURE HB_LANG_ELWIN() ; RETURN
PROCEDURE HB_LANG_ESWIN() ; RETURN
PROCEDURE HB_LANG_HE862() ; RETURN
PROCEDURE HB_LANG_HEWIN() ; RETURN
PROCEDURE HB_LANG_HR646() ; RETURN
PROCEDURE HB_LANG_HR852() ; RETURN
PROCEDURE HB_LANG_HRISO() ; RETURN
PROCEDURE HB_LANG_HRWIN() ; RETURN
PROCEDURE HB_LANG_HU852() ; RETURN
PROCEDURE HB_LANG_HUISO() ; RETURN
PROCEDURE HB_LANG_HUWIN() ; RETURN
PROCEDURE HB_LANG_IS850() ; RETURN
PROCEDURE HB_LANG_LTWIN() ; RETURN
PROCEDURE HB_LANG_PL852() ; RETURN
PROCEDURE HB_LANG_PLISO() ; RETURN
PROCEDURE HB_LANG_PLMAZ() ; RETURN
PROCEDURE HB_LANG_PLWIN() ; RETURN
PROCEDURE HB_LANG_PTISO() ; RETURN
PROCEDURE HB_LANG_RU866() ; RETURN
PROCEDURE HB_LANG_RUKOI8() ; RETURN
PROCEDURE HB_LANG_RUWIN() ; RETURN
PROCEDURE HB_LANG_SK852() ; RETURN
PROCEDURE HB_LANG_SKISO() ; RETURN
PROCEDURE HB_LANG_SKKAM() ; RETURN
PROCEDURE HB_LANG_SKWIN() ; RETURN
PROCEDURE HB_LANG_SL646() ; RETURN
PROCEDURE HB_LANG_SL852() ; RETURN
PROCEDURE HB_LANG_SLISO() ; RETURN
PROCEDURE HB_LANG_SLWIN() ; RETURN
PROCEDURE HB_LANG_SR852() ; RETURN
PROCEDURE HB_LANG_SRISO() ; RETURN
PROCEDURE HB_LANG_SRWIN() ; RETURN
PROCEDURE HB_LANG_SVWIN() ; RETURN
PROCEDURE HB_LANG_TR857() ; RETURN
PROCEDURE HB_LANG_TRWIN() ; RETURN
PROCEDURE HB_LANG_UA866() ; RETURN
PROCEDURE HB_LANG_UADOS() ; RETURN
PROCEDURE HB_LANG_UAKOI8() ; RETURN
PROCEDURE HB_LANG_UAWIN() ; RETURN
PROCEDURE HB_LANG_ZHB5() ; RETURN
PROCEDURE HB_LANG_ZHGB() ; RETURN

#endif


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Generate Harbour code for: Harbour contribution module 'hbmisc' (Miscellaneous utility functions): contrib/hbmisc/numtxten.prg. Provides functions: NumToTxtEN. This file provides utility functions

[Assistant]
FUNCTION NumToTxtEN( nValue )

   LOCAL cRetVal := ""

   IF nValue == 0
      RETURN "zero"
   ENDIF

   IF nValue < 0
      nValue := -nValue
      cRetVal += "minus "
   ENDIF

   IF nValue >= 1000000
      IF nValue >= 100000000
         cRetVal += int_to_string( Int( nValue / 100000000 ) ) + " hundred "
         nValue -= 100000000
         cRetVal += int_to_string( Int( nValue / 1000000 ) ) + " "
         nValue -= 1000000
      cRetVal += "million "
   ENDIF
   IF nValue >= 1000
      IF nValue >= 100000
         cRetVal += int_to_string( Int( nValue / 100000 ) ) + " hundred "
         nValue -= 100000
         cRetVal += int_to_string( Int( nValue / 1000 ) ) + " "
         nValue -= 1000
      cRetVal += "thousand "
   ENDIF
   IF nValue >= 100
      cRetVal += int_to_string( Int( nValue / 100 ) ) + " hundred "
      nValue -= 100
      "one", ;
      "two", ;
      "three", ;
      "four", ;
      "five", ;
      "six", ;
      "seven", ;
      "eight", ;
      "nine", ;
      "ten", ;
      "eleven", ;
      "twelve", ;
      "thirteen", ;
      "fourteen", ;
      "fifteen", ;
      "sixteen", ;
      "seventeen", ;
      "eighteen", ;
      "nineteen" }

   LOCAL aArray2 := { ;
      "ten", ;
      "twenty", ;
      "thirty", ;
      "forty", ;
      "fifty", ;
      "sixty", ;
      "seventy", ;
      "eighty", ;
      "ninety" }

   IF nValue < 20
      cRetVal := aArray1[ nValue ]
   ELSE
      cRetVal := aArray2[ Int( nValue / 10 ) ]
      nValue -= 10
         cRetVal += " " + aArray1[ Int( nValue ) ]
      ENDIF
   ENDIF

   RETURN cRetVal


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Write Harbour functions: ft_ANoMatches. Harbour contribution module 'hbnf' (NanForum Toolkit - legacy Clipper compatibility functions): contrib/hbnf/anomatch.prg. Provides functions: ft_ANoMatches. This file provides legacy compatibility functions

[Assistant]
#define FORCE_BETWEEN( x, y, z )         ( y := Max( Min( y, z ), x ) )

FUNCTION ft_ANoMatches( aArray, bCompareBlock, nStartIndex, nEndIndex )

   LOCAL nNoOfMatches := 0

   __defaultNIL( @nStartIndex, 1 )
   __defaultNIL( @nEndIndex, Len( aArray ) )

   FORCE_BETWEEN( 1, nEndIndex,   Len( aArray ) )
   FORCE_BETWEEN( 1, nStartIndex, nEndIndex )

   AEval( aArray, ;
      {| xElement | ;
      iif( Eval( bCompareBlock, xElement ), nNoOfMatches++, NIL ) }, ;
      nStartIndex, nEndIndex - nStartIndex + 1 )

   RETURN nNoOfMatches


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Implement this Harbour module: Header file for contribution module 'xhb' (Extended Harbour functions): contrib/xhb/xhbcls.ch. Defines constants: XHB_CLS__CH_. Declares 5 preprocessor commands. Declares 4 preprocessor translations. Defines Harbour internal constants and macros

[Assistant]
#ifndef XHB_CLS__CH_
#define XHB_CLS__CH_

#ifdef __HARBOUR__

#ifndef __XHARBOUR__

   #include "hboo.ch"

   #xtranslate __xhb_cls_scope( <scope>, .T. ) => <scope> + HB_OO_CLSTP_PERSIST
   #xtranslate __xhb_cls_scope( <scope>, .F. ) => <scope>
   #xtranslate __xhb_cls_scope( , .T. ) => HB_OO_CLSTP_PERSIST
   #xtranslate __xhb_cls_scope( , .F. ) =>

   #xcommand OVERRIDE METHOD <!Message!> [IN] CLASS <!Class!> ;
                             WITH [METHOD] <!Method!> [SCOPE <Scope>] => ;
            __clsModMsg( <Class>():classH, #<Message>, @<Method>() )

   #xcommand EXTEND CLASS <!Class!> WITH <data: DATA, VAR> <!VarName!> ;
                          [SCOPE <scope>] [<persist: PERSISTENT>] ;
                          [<case: NOUPPER>] => ;
            __clsAddMsg( <Class>():classH, #<VarName>, ;
                         __cls_IncData( <Class>():classH ), ;
                         HB_OO_MSG_PROPERTY, NIL, ;
                         __xhb_cls_scope( <scope>, <.persist.> ) )

   #xcommand EXTEND CLASS <!Class!> WITH METHOD <!Method!> [SCOPE <scope>] ;
                          [<persist: PERSISTENT>] [<case: NOUPPER>] => ;
            __clsAddMsg( <Class>():classH, #<Method>, @<Method>(), ;
                         HB_OO_MSG_METHOD, NIL, ;
                         __xhb_cls_scope( <scope>, <.persist.> ) )

   #xcommand EXTEND CLASS <!Class!> WITH MESSAGE <!Message!> METHOD <!Method!> ;
                          [SCOPE <scope>] [<persist: PERSISTENT>] ;
                          [<case: NOUPPER>] => ;
            __clsAddMsg( <Class>():classH, #<Message>, @<Method>(), ;
                         HB_OO_MSG_METHOD, NIL, ;
                         __xhb_cls_scope( <scope>, <.persist.> ) )

   #xcommand EXTEND CLASS <!Class!> WITH MESSAGE <!Message!> INLINE <code,...> ;
                          [SCOPE <scope>] [<persist: PERSISTENT>] ;
                          [<case: NOUPPER>] => ;
            __clsAddMsg( <Class>():classH, #<Message>, ;
                         {| Self | HB_SYMBOL_UNUSED( Self ), <code> }, ;
                         HB_OO_MSG_INLINE, NIL, ;
                         __xhb_cls_scope( <scope>, <.persist.> ) )

   #xcommand EXTEND CLASS <!Class!> WITH MESSAGE <Message>( <params,...> ) ;
                          INLINE <code,...> ;
                          [SCOPE <scope>] [<persist: PERSISTENT>] ;
                          [<case: NOUPPER>] => ;
            __clsAddMsg( <Class>():classH, #<Message>, ;
                         {| Self, <params> | HB_SYMBOL_UNUSED( Self ), <code> }, ;
                         HB_OO_MSG_INLINE, NIL, ;
                         __xhb_cls_scope( <scope>, <.persist.> ) )

#endif

#endif

#endif


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Implement these Harbour functions: Harbour contribution module 'xhb' (Extended Harbour functions): contrib/xhb/xhbver.prg. Provides functions: hb_BuildInfo. This file provides legacy compatibility functions

[Assistant]
#include "hbver.ch"

#include "xhbver.ch"

FUNCTION hb_BuildInfo( n )

   LOCAL v := Array( _HB_VER_LAST - 1 )

   v[ _HB_VER_MAJOR              ] := hb_Version( HB_VERSION_MAJOR )
   v[ _HB_VER_MINOR              ] := hb_Version( HB_VERSION_MINOR )
   v[ _HB_VER_REVISION           ] := hb_Version( HB_VERSION_RELEASE )
   v[ _HB_VER_LEX                ] := "Flex"
   v[ _HB_VER_AS_STRING          ] := hb_Version( HB_VERSION_HARBOUR )
   v[ _HB_PCODE_VER              ] := hb_Version( HB_VERSION_PCODE_VER )
   v[ _HB_VER_COMPILER           ] := hb_Version( HB_VERSION_COMPILER )
   v[ _HB_VER_PLATFORM           ] := OS()
   v[ _HB_VER_BUILD_DATE         ] := Left( hb_Version( HB_VERSION_BUILD_DATE_STR ), 11 )
   v[ _HB_VER_BUILD_TIME         ] := hb_Version( HB_VERSION_BUILD_TIME )
   v[ _HB_VER_LENTRY             ] := hb_Version( HB_VERSION_CHANGELOG_LAST )
   v[ _HB_VER_CHLCVS             ] := hb_Version( HB_VERSION_CHANGELOG_ID )
   v[ _HB_VER_C_USR              ] := hb_Version( HB_VERSION_FLAG_C )
   v[ _HB_VER_L_USR              ] := hb_Version( HB_VERSION_FLAG_LINKER )
   v[ _HB_VER_PRG_USR            ] := hb_Version( HB_VERSION_FLAG_PRG )
   v[ _HB_EXTENSION              ] := .F.
#ifdef HB_CLP_UNDOC
   v[ _HB_C52_UNDOC              ] := .T.
#else
   v[ _HB_C52_UNDOC              ] := .F.
#endif
#ifdef HB_CLP_STRICT
   v[ _HB_C52_STRICT             ] := .T.
#else
   v[ _HB_C52_STRICT             ] := .F.
#endif
#ifdef HB_COMPAT_C53
   v[ _HB_COMPAT_C53             ] := .T.
#else
   v[ _HB_COMPAT_C53             ] := .F.
#endif
   v[ _HB_COMPAT_XPP             ] := .T.
   v[ _HB_COMPAT_VO              ] := .T.
#ifdef HB_COMPAT_FLAGSHIP
   v[ _HB_COMPAT_FLAGSHIP        ] := .T.
#else
   v[ _HB_COMPAT_FLAGSHIP        ] := .F.
#endif
#ifdef HB_COMPAT_FOXPRO
   v[ _HB_COMPAT_FOXPRO          ] := .T.
#else
   v[ _HB_COMPAT_FOXPRO          ] := .F.
#endif
   v[ _HB_COMPAT_DBASE           ] := .T.
   v[ _HB_HARBOUR_OBJ_GENERATION ] := .F.
   v[ _HB_HARBOUR_STRICT_ANSI_C  ] := .F.
   v[ _HB_CPLUSPLUS              ] := hb_Version( HB_VERSION_COMPILER_CPP )
   v[ _HB_HARBOUR_YYDEBUG        ] := .F.
   v[ _HB_SYMBOL_NAME_LEN        ] := 63
   v[ _HB_MULTITHREAD            ] := hb_mtvm()
   v[ _HB_VM_OPTIMIZATION        ] := 2
   v[ _HB_LANG_ID                ] := hb_langSelect()
   v[ _HB_ARRAY_MODE             ] := 0
   v[ _HB_CREDITS                ] := { "See 'harbour -credits'" }

   RETURN iif( HB_ISNUMERIC( n ), iif( n <= Len( v ), v[ n ], NIL ), v )


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Implement the following Harbour classes: THtmlFrameSet. Harbour contribution module 'xhb' (Extended Harbour functions): contrib/xhb/tframe.prg. Defines classes: THtmlFrameSet. This file provides legacy compatibility functions

[Assistant]
#include "hbclass.ch"
#include "cgi.ch"

CREATE CLASS THtmlFrameSet

   VAR nH
   VAR FName
   VAR cStr INIT ""

   VAR TITLE INIT "FrameSet01"

   METHOD New( cFName, cTitle )

   METHOD StartSet( aRows, aCols, onLoad, onUnload )

   METHOD EndSet()

   METHOD End()

   METHOD Frame( cName, cURL, lBorder, lResize, lScrolling, ;
      marginwidth, marginheight, cTarget, cScrolling )

ENDCLASS

METHOD New( cFName, cTitle ) CLASS THtmlFrameSet

   LOCAL cStr

   __defaultNIL( @cTitle, "" )

   ::FName := cFName
   ::Title := cTitle

   IF HB_ISSTRING( ::FName )
      cStr := ""
      ::nH := FCreate( ::FName )
   ELSE
      cStr := "Content-Type: text/html" + CRLF() + CRLF()
      ::nH := STD_OUT
   ENDIF

   cStr += "<html>" + CRLF() + ;
      " <head>" + CRLF() + ;
      "  <title>" + ::Title + "</title>" + CRLF() + ;
      " </head>" + CRLF()

   ::cStr += cStr

   RETURN Self

METHOD StartSet( aRows, aCols, onLoad, onUnload ) CLASS THtmlFrameSet

   LOCAL cStr
   LOCAL cItem

   cStr := CRLF() + " <frameset "

   IF HB_ISARRAY( aRows ) .AND. ! Empty( aRows )

      cStr += ' rows="'

      FOR EACH cItem in aRows
         IF cItem:__enumIndex() > 1
            cStr += ","
         ENDIF
         cStr += cItem
      NEXT

      cStr += '"'
   ENDIF

   IF HB_ISARRAY( aCols ) .AND. ! Empty( aCols )

      cStr += ' cols="'

      FOR EACH cItem IN aCols
         IF cItem:__enumIndex() > 1
            cStr += ","
         ENDIF
         cStr += cItem
      NEXT

      cStr += '"'
   ENDIF

   IF HB_ISSTRING( onLoad )
      cStr += Space( 7 ) + ' onLoad="' + onLoad + '"'
   ENDIF

   IF HB_ISSTRING( onUnLoad )
      cStr += Space( 5 ) + ' onUnLoad="' + onUnLoad + '"'
   ENDIF

   cStr += " >" + CRLF()

   ::cStr += cStr

   RETURN Self

METHOD Endset() CLASS THtmlFrameSet

   ::cStr += " </frameset>" + CRLF()

   RETURN Self

METHOD End() CLASS THtmlFrameSet

   ::cStr += "</html>" + CRLF()

   FWrite( ::nH, ::cStr )

   IF ::FName != NIL
      FClose( ::nH )
   ENDIF

   RETURN Self

METHOD Frame( cName, cURL, lBorder, lResize, lScrolling, ;
      marginwidth, marginheight, cTarget, cScrolling ) CLASS THtmlFrameSet

   LOCAL cStr

   __defaultNIL( @lBorder, .T. )
   __defaultNIL( @lResize, .T. )
   __defaultNIL( @lScrolling, .F. )
   __defaultNIL( @cScrolling, "AUTO" )
   __defaultNIL( @cTarget, "_self" )

   cStr := "  <frame "

   IF HB_ISSTRING( cName )
      cStr += ' name="' + cName + '"'
   ENDIF

   IF HB_ISSTRING( cUrl )
      cStr += ' src="' + cURL + '"'
   ENDIF

   IF HB_ISSTRING( cTarget )
      cStr += ' target="' + cTarget + '"'
   ENDIF

   IF ! lBorder
      cStr += ' frameborder="0"'
   ELSE
      cStr += ' frameborder="1"'
   ENDIF

   IF ! lResize
      cStr += " noresize"
   ENDIF

   IF HB_ISSTRING( cScrolling )
      cStr += ' scrolling="' + cScrolling + '"'
   ELSE
      IF lScrolling != NIL
         cStr += ' scrolling=' + iif( lScrolling, '"yes"', '"no"' )
      ELSE
         cStr += ' scrolling="auto"'
      ENDIF
   ENDIF

   IF HB_ISNUMERIC( marginwidth )
      cStr += " marginwidth= " + hb_ntos( marginwidth )
   ENDIF

   IF HB_ISNUMERIC( marginheight )
      cStr += " marginheight= " + hb_ntos( marginheight )
   ENDIF

   cStr += ">" + CRLF()

   ::cStr += cStr

   RETURN Self


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User]
Here is a Harbour (xBase/Clipper) implementation:

Harbour test program: tests/gtxfnt.prg. Provides functions: xfontsel. This test file exercises basic Harbour language features

[Assistant]
#include "hbgtinfo.ch"

#if ! defined( __HBSCRIPT__HBSHELL )
   #if defined( __PLATFORM__UNIX )
      REQUEST HB_GT_XWC_DEFAULT
   #endif
#endif

proc main()
   local cChars, i, j, n

#if defined( __HBSCRIPT__HBSHELL )
   #if defined( __PLATFORM__UNIX )
      hbshell_gtSelect( "GTXWC" )
   #endif
#endif

   cChars := ""
   for i := 0 to 7
      cChars += ";"
      for j := 0 to 31
         n := i
         cChars += iif( n == Asc( ";" ), ",", ;
                   iif( n == 10, " ", Chr( n ) ) )
      next
   next

   n := 2
   ? "GT" + hb_gtVersion(), hb_gtVersion( 1 )
   hb_gtInfo( HB_GTI_FONTATTRIBUTE, HB_GTI_FONTA_FIXMETRIC + ;
              HB_GTI_FONTA_CLRBKG + HB_GTI_FONTA_DRAWBOX )
   while n == 2
      ? hb_gtInfo( HB_GTI_FONTSEL )
      hb_gtInfo( HB_GTI_FONTSEL, xFontSel() )
      n := Alert( "What do you think about this font;;" + ;
                  hb_gtInfo( HB_GTI_FONTSEL ) + ";" + cChars, ;
                  { "FINE", "CHANGE" } )
   enddo
   ? "current font:"
   ? hb_gtInfo( HB_GTI_FONTSEL )
   OutStd( hb_gtInfo( HB_GTI_FONTSEL ) )
   wait
return

function xfontsel()
   local cStdOut
   hb_processRun( "xfontsel -print",, @cStdOut )
return cStdOut


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Create Harbour preprocessor definitions: Harbour contribution module 'hbnetio' (Network I/O operations): contrib/hbnetio/tests/netiotst.prg. Contains procedures: Main, createdb, testdb. This file provides network protocol implementations

[Assistant]
#require "hbnetio"

#define DBSERVER  "127.0.0.1"
#define DBPORT    2941
#define DBPASSWD  "topsecret"
#define DBDIR     "data"
#define DBFILE    "_tst_"

#define DBNAME    "net:" + DBSERVER + ":" + hb_ntos( DBPORT ) + ":" + ;
                  DBPASSWD + ":" + DBDIR + "/" + DBFILE

REQUEST DBFCDX

REQUEST hb_DirExists
REQUEST hb_DirCreate

PROCEDURE Main()

   LOCAL pSockSrv, lExists

   SET EXCLUSIVE OFF
   rddSetDefault( "DBFCDX" )

   pSockSrv := netio_MTServer( DBPORT,,,  .T., DBPASSWD )
   IF Empty( pSockSrv )
      ? "Cannot start NETIO server !!!"
      WAIT "Press any key to exit..."
      QUIT
   ENDIF

   ? "NETIO server activated."
   hb_idleSleep( 0.1 )
   WAIT

   ?
   ? "netio_Connect():", netio_Connect( DBSERVER, DBPORT, , DBPASSWD )
   ?

   lExists := netio_FuncExec( "HB_DirExists", "./data" )
   ? "Directory './data'", iif( ! lExists, "not exists", "exists" )
   IF ! lExists
      ? "Creating directory './data' ->", ;
         iif( netio_FuncExec( "hb_DirCreate", "./data" ) == -1, "error", "OK" )
   ENDIF

   ? "'" + DBNAME + "'"
   createdb( DBNAME )
   testdb( DBNAME )
   WAIT

   ?
   ? "table exists:", dbExists( DBNAME )
   WAIT

   ?
   ? "delete table with indexes:", dbDrop( DBNAME )
   ? "table exists:", dbExists( DBNAME )
   WAIT

   ? "netio_Disconnect():", netio_Disconnect( DBSERVER, DBPORT )

   ?
   ? "stopping the server..."
   netio_ServerStop( pSockSrv, .T. )

   RETURN

PROCEDURE createdb( cName )

   LOCAL n

   dbCreate( cName, { ;
      { "F1", "C", 20, 0 }, ;
      { "F2", "M",  4, 0 }, ;
      { "F3", "N", 10, 2 }, ;
      { "F4", "T",  8, 0 } } )
   ? "create neterr:", NetErr(), hb_osError()
   USE ( cName )
   ? "use neterr:", NetErr(), hb_osError()
   WHILE LastRec() < 100
      dbAppend()
      n := RecNo() - 1
      field->F1 := Chr( n % 26 + Asc( "A" ) ) + " " + Time()
      field->F2 := field->F1
      field->F3 := n / 100
      field->F4 := hb_DateTime()
   ENDDO
   INDEX ON field->F1 TAG T1
   INDEX ON field->F3 TAG T3
   INDEX ON field->F4 TAG T4
   CLOSE
   ?

   RETURN

PROCEDURE testdb( cName )

   LOCAL i, j

   USE ( cName )
   ? "used:", Used()
   ? "nterr:", NetErr()
   ? "alias:", Alias()
   ? "lastrec:", LastRec()
   ? "ordCount:", ordCount()
   FOR i := 1 TO ordCount()
      ordSetFocus( i )
      ? i, "name:", ordName(), "key:", ordKey(), "keycount:", ordKeyCount()
   NEXT
   ordSetFocus( 1 )
   dbGoTop()
   WHILE ! Eof()
      IF ! field->F1 == field->F2
         ? "error at record:", RecNo()
         ? "  ! '" + field->F1 + "' == '" + field->F2 + "'"
      ENDIF
      dbSkip()
   ENDDO
   WAIT
   i := Row()
   j := Col()
   dbGoTop()
   Browse()
   SetPos( i, j )
   CLOSE

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User]
Here is a Harbour (xBase/Clipper) implementation:

Header file for contribution module 'xhb' (Extended Harbour functions): contrib/xhb/hbdll.ch. Defines 7 constants including: __DLL_CH, DC_MICROSOFT, DC_BORLAND, DC_CALL_CDECL, DC_CALL_STD. Declares 5 preprocessor commands. Defines threading constants and macros

[Assistant]
#include "dll.ch"

#ifndef __DLL_CH
#define __DLL_CH

#define DC_MICROSOFT           0x0000
#define DC_BORLAND             0x0001
#define DC_CALL_CDECL          DLL_CDECL
#define DC_CALL_STD            DLL_STDCALL
#define DC_RETVAL_MATH4        0x0100
#define DC_RETVAL_MATH8        0x0200

#include "cstruct.ch"
#include "wintypes.ch"

#xcommand IMPORT [<Qualifier: STATIC>] [<CallConvention: 0x0000, 0x0001, 0x0010, 0x0020, 0x0100, 0x0200> ] ;
                 <FuncName>( [<ArgName> [, <ArgNameN>] ] ) FROM [<!DllFuncName!> OF ] <(DllName)> => ;
    [<Qualifier>] FUNCTION <FuncName>( <ArgName> [, <ArgNameN>] ) ;;
       THREAD STATIC t_cTemplate ;;
       IF t_cTemplate == NIL ;;
          t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, <CallConvention>, DC_CALL_STD ), iif( <.DllFuncName.>, #<DllFuncName>, #<FuncName> ) ) ;;
       END ;;
       IF <.ArgName.>;;
          RETURN DllExecuteCall( t_cTemplate, <ArgName> [, <ArgNameN>] ) ;;
       END ;;
    RETURN DllExecuteCall( t_cTemplate )

#xcommand IMPORT [<Qualifier: STATIC>] [<CallConvention: 0x0000, 0x0001, 0x0010, 0x0020, 0x0100, 0x0200> ] ;
                 <FuncName>( [<ArgName> [, <ArgNameN>] ] ) FROM <(DllName)> [EXPORTED AS <!DllFuncName!>] => ;
    [<Qualifier>] FUNCTION <FuncName>( <ArgName> [, <ArgNameN>] ) ;;
       THREAD STATIC t_cTemplate ;;
       IF t_cTemplate == NIL ;;
          t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, <CallConvention>, DC_CALL_STD ), iif( <.DllFuncName.>, #<DllFuncName>, #<FuncName> ) ) ;;
       END ;;
       IF <.ArgName.>;;
          RETURN DllExecuteCall( t_cTemplate, <ArgName> [, <ArgNameN>] ) ;;
       END ;;
    RETURN DllExecuteCall( t_cTemplate )

#xcommand IMPORT [<Qualifier: STATIC>] [<CallConvention: 0x0000, 0x0001, 0x0010, 0x0020, 0x0100, 0x0200> ] ;
                 <Type> <FuncName>( [0] [<ArgType> <ArgName> [, <ArgTypeN> <ArgNameN>] ] ) FROM <(DllName)> [EXPORTED AS <!DllFuncName!>] => ;
    [<Qualifier>] FUNCTION <FuncName>( <ArgName> [, <ArgNameN>] ) ;;
       THREAD STATIC t_cTemplate ;;
       IF t_cTemplate == NIL ;;
          t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, <CallConvention>, DC_CALL_STD ), iif( <.DllFuncName.>, #<DllFuncName>, #<FuncName> ) ) ;;
       END ;;
       IF <.ArgName.>;;
          RETURN DllExecuteCall( t_cTemplate, <ArgName> [, <ArgNameN>] ) ;;
       END ;;
    RETURN DllExecuteCall( t_cTemplate )

#xcommand IMPORT [<Qualifier: STATIC>] [<CallConvention: 0x0000, 0x0001, 0x0010, 0x0020, 0x0100, 0x0200> ] ;
                 <Type> <FuncName>( [0] [<ArgType> <ArgName> [, <ArgTypeN> <ArgNameN>] ] ) FROM [<!DllFuncName!> OF ] <(DllName)> => ;
    [<Qualifier>] FUNCTION <FuncName>( <ArgName> [, <ArgNameN>] ) ;;
       THREAD STATIC t_cTemplate ;;
       IF t_cTemplate == NIL ;;
          t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.CallConvention.>, <CallConvention>, DC_CALL_STD ), iif( <.DllFuncName.>, #<DllFuncName>, #<FuncName> ) ) ;;
       END ;;
       IF <.ArgName.>;;
          RETURN DllExecuteCall( t_cTemplate, <ArgName> [, <ArgNameN>] ) ;;
       END ;;
    RETURN DllExecuteCall( t_cTemplate )

#xcommand DECLARE <!Type!> <!FuncName!> IN <(DllName)> [AS <(DllFuncName)>] [<ArgType> [@] [<ArgName>] [, <ArgTypeN> [@] [<ArgNameN>]]] => ;
    FUNCTION <FuncName>( ... ) ;;
       THREAD STATIC t_cTemplate ;;
       IF t_cTemplate == NIL ;;
          t_cTemplate := DllPrepareCall( <(DllName)>, DC_CALL_STD, iif( <.DllFuncName.>, <(DllFuncName)>, #<FuncName> ) ) ;;
       END ;;
    RETURN DllExecuteCall( t_cTemplate, ... )

#xcommand DLL [<Qualifier: STATIC>] FUNCTION <FuncName>( [ <ArgName> AS <ArgType> ] [, <ArgNameN> AS <ArgTypeN> ] ) AS <Type> [<Pascal: PASCAL>] [ FROM <DllFuncName> ] LIB <(DllName)> => ;
    [<Qualifier>] FUNCTION <FuncName>( <ArgName> [, <ArgNameN>] ) ;;
       THREAD STATIC t_cTemplate ;;
       IF t_cTemplate == NIL ;;
          t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.Pascal.>, DC_CALL_STD, DC_CALL_CDECL ), iif( <.DllFuncName.>, <(DllFuncName)>, #<FuncName> ) ) ;;
       END ;;
    RETURN DllExecuteCall( t_cTemplate [, <ArgName>] [, <ArgNameN>] )

#xcommand DLL32 [<Qualifier: STATIC>] FUNCTION <FuncName>( [ <ArgName> AS <ArgType> ] [, <ArgNameN> AS <ArgTypeN> ] ) AS <Type> [<Pascal: PASCAL>] [ FROM <DllFuncName> ] LIB <(DllName)> => ;
    [<Qualifier>] FUNCTION <FuncName>( <ArgName> [, <ArgNameN>] ) ;;
       THREAD STATIC t_cTemplate ;;
       IF t_cTemplate == NIL ;;
          t_cTemplate := DllPrepareCall( <(DllName)>, iif( <.Pascal.>, DC_CALL_STD, DC_CALL_CDECL ), iif( <.DllFuncName.>, <(DllFuncName)>, #<FuncName> ) ) ;;
       END ;;
    RETURN DllExecuteCall( t_cTemplate [, <ArgName>] [, <ArgNameN>] )

#endif


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Implement these Harbour functions: Harbour contribution module 'gtwvw' (): contrib/gtwvw/tests/eb7.prg. Provides functions: MyHelp, WVW_SETFOCUS, AddEBGet. Contains procedures: Main, GetSession, EBReadGets. This file provides platform-specific functionality

[Assistant]
#require "gtwvw"

#include "inkey.ch"
#include "setcurs.ch"

#define EN_SETFOCUS         0x0100
#define EN_KILLFOCUS        0x0200
#define EN_CHANGE           0x0300
#define EN_UPDATE           0x0400
#define EN_ERRSPACE         0x0500
#define EN_MAXTEXT          0x0501
#define EN_HSCROLL          0x0601
#define EN_VSCROLL          0x0602

#define WM_KEYFIRST                     0x0100
#define WM_KEYDOWN                      0x0100
#define WM_KEYUP                        0x0101
#define WM_CHAR                         0x0102
#define WM_DEADCHAR                     0x0103
#define WM_SYSKEYDOWN                   0x0104
#define WM_SYSKEYUP                     0x0105
#define WM_SYSCHAR                      0x0106
#define WM_SYSDEADCHAR                  0x0107
#define WM_KEYLAST                      0x0108
#define WM_INITDIALOG                   0x0110
#define WM_COMMAND                      0x0111
#define WM_SYSCOMMAND                   0x0112
#define WM_TIMER                        0x0113
#define WM_HSCROLL                      0x0114
#define WM_VSCROLL                      0x0115
#define WM_INITMENU                     0x0116
#define WM_INITMENUPOPUP                0x0117
#define WM_MENUSELECT                   0x011F
#define WM_MENUCHAR                     0x0120
#define WM_ENTERIDLE                    0x0121

#command @ <row>, <col> EBGET <var>                                       ;
      [LABEL <label>]                                   ;
      [<multiline: MULTILINE>]                        ;
      [PICTURE <pic>]                                 ;
      ;
      => AddEBGet( aEBGets, <row>, <col>, @<var>, <"var">, {| x | <var> := x }, <label>, <.multiline.>, <pic> )

#define __GET_LMULTILINE 1
#define __GET_CLABEL 2
#define __GET_NROW   3
#define __GET_NCOL   4
#define __GET_XINIT  5
#define __GET_CPICT  6
#define __GET_CVALTYPE  7
#define __GET_BTEXT   8
#define __GET_BASSIGN 9
#define __GET_NEBID  10
#define __GET_LFOCUSED  11

PROCEDURE Main()

   LOCAL lClosepermitted := .F.
   LOCAL bSetKey := SetKey( K_F8, {|| MyHelp() } )

#if defined( __HBSCRIPT__HBSHELL ) .AND. defined( __PLATFORM__WINDOWS )
   hbshell_gtSelect( "GTWVW" )
#endif

   Set( _SET_DATEFORMAT, "yyyy-mm-dd" )
   SetMode( 4, 54 )
   SetColor( "N/W" )
   wvw_SetFont( 0, "Courier New", 16, - 7 )
   wvw_ebSetFont( 0, "Arial" )
   wvw_pbSetFont( 0, "Arial" )

   wvw_SetCodepage( 0, 255 )
   wvw_AllowNonTopEvent( .T. )

   wvw_RecurseCBlock( .T. )

   SetCursor( SC_NONE )

   CLS
   @ 0, 1 SAY "Click NEW to open a new GET session, CLOSE when done"
   wvw_pbCreate( 0, 2, 1, 2, 10, "New", NIL, {|| GetSession() } )
   wvw_pbCreate( 0, 2, 12, 2, 22, "Close", NIL, {|| ToCloseWindow( 0, @lClosepermitted ) } )

   wvw_ShowWindow( 0 )

   DO WHILE ! lClosepermitted
      Inkey( 0.2 )
   ENDDO
   SetKey( K_F8, bSetKey )

   RETURN

PROCEDURE GetSession()

   STATIC s_nsession := 0
   LOCAL aEBGets := {}
   LOCAL cName      := Space( 30 )
   LOCAL cNickName  := Space( 10 )
   LOCAL dBirthdate := hb_SToD()
   LOCAL nBudget    := 125000
   LOCAL cRemark    := "Some notes" + hb_eol() + ;
      "about this person"
   LOCAL nwinnum
   LOCAL nrow1, ncol1, nrow2, ncol2
   LOCAL cdebugreport

   IF s_nsession > 15
      MyMessageBox( 0, "Sorry, maximum number of sessions reached" )
      RETURN
   ENDIF

   s_nsession++
   nwinnum := s_nsession

   nrow1 := 4 + ( s_nsession - 1 )
   wvw_nOpenWindow( "Session " + hb_ntos( s_nsession ) + " (press F8 for help)", ;
      nrow1, ncol1, nrow2, ncol2, NIL, 0 )

   cRemark += hb_eol() + "(from Session " + hb_ntos( nwinnum ) + ")"

   @ 1, 15 ebGET cName      LABEL "Name:"
   @ 3, 15 ebGET cNickName  LABEL "Nickname:"   PICTURE Replicate( "!", Len( cNickName ) )
   @ 5, 15 ebGET dBirthDate LABEL "Birth Date:"
   @ 7, 15 ebGET nBudget    PICTURE "999,999.99"
   @ 9, 15 ebGET cRemark    LABEL "Remarks:" MULTILINE
   EBReadGets( nwinnum, @aEBGets )

   cdebugreport := "Back to GetSession() of window " + hb_ntos( nwinnum ) + " with these values returned:" + hb_eol()
   cdebugreport += "cName:" + cName + hb_eol()
   cdebugreport += "cNickName:" + cNickName + hb_eol()
   cdebugreport += "dBirthDate:" + DToC( dBirthDate ) + hb_eol()
   cdebugreport += "nBudget:" + Transform( nBudget, "999,999.99" ) + hb_eol()
   cdebugreport += "cRemark:" + cRemark
   MyMessageBox( nwinnum, cdebugreport )

   wvw_lCloseWindow()

   s_nsession--

   RETURN

FUNCTION MyHelp()

   LOCAL ccallstack, i

   ccallstack := ""
   FOR i := 0 TO 8
      ccallstack += hb_ntos( i ) + ". " + ProcName( i ) + "(" + hb_ntos( ProcLine( i ) ) + ")" + hb_eol()
   NEXT

   MyMessageBox( NIL, ;
      "Sorry, this is not really a help :-)" + hb_eol() + ;
      "It is only to show that SetKey() codeblock is handled by our editboxes" + hb_eol() + ;
      "Call stack:" + hb_eol() + ;
      ccallstack )

   RETURN NIL

FUNCTION WVW_SETFOCUS( nWinNum, hWnd )

   HB_SYMBOL_UNUSED( hWnd )

   IF nwinnum != 0
      wvw_nSetCurWindow( nwinnum )
   ENDIF

   RETURN NIL

FUNCTION AddEBGet( aEBGets, mnrow, mncol, mxValue, mcVarName, mbAssign, mcLabel, mlMultiline, mcPict )

   LOCAL mcVarType, mbText

   mcVarType := ValType( mxValue )
   DO CASE
   CASE mcVarType == "C"
      mcPict := iif( HB_ISSTRING( mcPict ), mcPict, Replicate( "X", Len( mxValue ) ) )
      mbText := {|| mxValue }
   CASE mcVarType == "N"
      mcPict := iif( HB_ISSTRING( mcPict ), mcPict, "999,999,999.99" )
      mbText := {|| Transform( mxValue, mcPict ) }
   CASE mcVarType == "D"
      mcPict := iif( HB_ISSTRING( mcPict ), mcPict, "9999-99-99" )
      mbText := {|| DToC( mxValue ) }
   OTHERWISE

      RETURN .F.
   ENDCASE

   hb_default( @aEBGEts, {} )

   IF ! HB_ISLOGICAL( mlMultiline ) .OR. ;
      ! HB_ISSTRING( mxValue )
      mlMultiline := .F.
   ENDIF
   hb_default( @mcLabel, mcVarName + ":" )

   AAdd( aEBGets, { ;
      mlMultiline, ;
      mcLabel, ;
      mnrow, ;
      mncol, ;
      mxValue, ;
      mcPict, ;
      mcVarType, ;
      mbText, ;
      mbAssign, ;
      NIL, ;
      .F. } )

   RETURN .T.

PROCEDURE EBReadGets( nwinnum, aEBGets )

   LOCAL nmaxrow, nmincol
   LOCAL i, nlen, lmultiline, clabel, ;
      nrow1, ncol1, nrow2, ncol2
   LOCAL nOKbutton, nCancelbutton, nClosebutton, ldone := .F.
   LOCAL lclosePermitted := .F.
   LOCAL nNumGets := Len( aEBGets )
   LOCAL ch
   LOCAL nfocus, lchangefocus

   IF nNumGets == 0
      RETURN
   ENDIF

   wvw_nSetCurWindow( nwinnum )
   nmaxrow := 0
   nmincol := 99999
   FOR i := 1 TO nNumGets
      lmultiline := aEBGets[ i ][ __GET_LMULTILINE ]
      IF ! lmultiline
         nlen := Len( aEBGets[ i ][ __GET_CPICT ] )
      ELSE
         nlen := 30
      ENDIF
      clabel := aEBGets[ i ][ __GET_CLABEL ]
      nrow1 := aEBGets[ i ][ __GET_NROW ]
      ncol1 := aEBGets[ i ][ __GET_NCOL ]
      nrow2 := iif( aEBGets[ i ][ __GET_LMULTILINE ], nrow1 + 3, nrow1 )
      ncol2 := ncol1 + nlen - 1

      @ nrow1, ncol1 - Len( clabel ) - 1 SAY clabel

      aEBGets[ i ][ __GET_NEBID ] := wvw_ebCreate( nwinnum, nrow1, ncol1, nrow2, ncol2, ;
         Transform( aEBGets[ i ][ __GET_XINIT ], aEBGets[ i ][ __GET_CPICT ] ), ;
         {| nWinNum, nId, nEvent | MaskEditBox( nWinNum, nId, nEvent, @aEBGets ) }, ;
         aEBGets[ i ][ __GET_LMULTILINE ], ;
      0, ;
      iif( lmultiline, NIL, nlen + 1 ), ;
      NIL, NIL )

      nmaxrow := Max( nmaxrow, nrow2 )
      nmincol := Min( nmincol, ncol1 )
   NEXT
   nrow1 := nmaxrow + 2
   ncol1 := nmincol
   nOKbutton := wvw_pbCreate( nwinnum, nrow1, ncol1, nrow1, ncol1 + 10 - 1, "OK", NIL, ;
      {|| SaveVar( nwinnum, @aEBGets, @lDone ), ;
      EndGets( nwinnum, @aEBGets, nOKbutton, nCancelbutton, nCloseButton );
      } )

   ncol1 := ncol1 + 10 + 1
   nCancelbutton := wvw_pbCreate( nwinnum, nrow1, ncol1, nrow1, ncol1 + 10 - 1, "Cancel", NIL, ;


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User]
Write the following Harbour (xBase/Clipper) code:

Harbour contribution module 'hbwin' (Windows API wrapper functions): contrib/hbwin/tests/oletst2.prg. Contains procedures: Main. This file provides platform-specific functionality

[Assistant]
#require "hbwin"

PROCEDURE Main()

   LOCAL oObject

   oObject := win_oleCreateObject( "MyOleTimeServer" )

   IF ! Empty( oObject )
      ? "DATE:", oObject:Date()
      ? "TIME:", oObject:Time()
      ? "DATTIME:", oObject:datetime()
      ? "VALUE:", oObject:value
      ? "GETDATA:", oObject:getdata()
      oObject:value := "hello"
      ? "VALUE:", oObject:value
      ? "GETDATA:", oObject:getdata()
   ELSE
      ? "Can not access 'MyOleTimeServer' OLE server."
   ENDIF

   WAIT

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Implement this Harbour module: Header file for contribution module 'hbct' (CA-Tools compatibility library): contrib/hbct/ct.ch. Defines 10 constants including: _CT_CH, CT_SUBSYSTEM, CT_ARGERR_WHOCARES, CT_ARGERR_WARNING, CT_ARGERR_ERROR. Defines error handling constants and codes

[Assistant]
#ifndef _CT_CH
#define _CT_CH 1

#define CT_SUBSYSTEM  "CT"

#include "error.ch"
#define CT_ARGERR_WHOCARES      ES_WHOCARES
#define CT_ARGERR_WARNING       ES_WARNING
#define CT_ARGERR_ERROR         ES_ERROR
#define CT_ARGERR_CATASTROPHIC  ES_CATASTROPHIC
#define CT_ARGERR_IGNORE        -1

#define CT_MATHERR_STATUS_NOTFOUND   -1
#define CT_MATHERR_STATUS_INACTIVE   0
#define CT_MATHERR_STATUS_ACTIVE     1

#define CT_MATHERR_MODE_NONE         0
#define CT_MATHERR_MODE_DEFAULT      1
#define CT_MATHERR_MODE_USER         2
#define CT_MATHERR_MODE_USERDEFAULT  3

#define CT_SETATLIKE_EXACT     0
#define CT_SETATLIKE_WILDCARD  1

#endif


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Implement this Harbour module: Harbour contribution module 'hbct' (CA-Tools compatibility library): contrib/hbct/tests/charxor.prg. Contains procedures: Main. This file provides legacy compatibility functions

[Assistant]
#ifdef __HARBOUR__
#require "hbct"
#endif

PROCEDURE Main()

   ctinit()

   ? "Begin test of CharXor()"
   ?

   ? "Simple tests:"
   ? '  CharXor( CharXor( "This is top secret !", "My Password" ),'
   ? '           "My Password" ) == "This is top secret !" ? ->'
   ? '  ' + CharXor( CharXor( "This is top secret !", "My Password" ), "My Password" )

   ? "End test of CharXor()"
   ?

   ctexit()

   RETURN


[System] You are an expert Harbour (xBase/Clipper) programmer. Write clean, efficient code following Harbour conventions. Use proper Hungarian notation for variable names (c=character, n=numeric, l=logical, a=array, o=object, b=codeblock).

[User] Generate Harbour code for: Harbour test program: tests/pp.prg. Contains procedures: Main. This test file tests specific function APIs

[Assistant]
PROCEDURE Main()
LOCAL b := ""
MEMVAR a
MEMVAR c
PRIVATE a

#command _REGULAR_(<z>) => ? <z>
#command _NORMAL_(<z>) => ? <"z">
#command _SMART_(<z>) => ? <(z)>
#command _DUMB_(<z>) => ? #<z>

#command _REGULAR_L(<z,...>) => s( <z> )
#command _NORMAL_L(<z,...>) => s( <"z"> )
#command _SMART_L(<z,...>) => s( <(z)> )
#command _DUMB_L(<z,...>) => s( #<z> )

USE &b ALIAS &a.1 INDEX &a.aa, &b, &c, &b.

? "< > REGULAR"
_REGULAR_(a)
_REGULAR_("a")
_REGULAR_('a')
_REGULAR_(["'a'"])
_REGULAR_(&a.1)
_REGULAR_(&a)
_REGULAR_(&a.)
_REGULAR_(&(a))
_REGULAR_(&a[1])
_REGULAR_(a[1])
_REGULAR_("['']")

? '< " " > NORMAL'
_NORMAL_(a)
_NORMAL_("a")
_NORMAL_('a')
_NORMAL_(["'a'"])
_NORMAL_(&a.1)
_NORMAL_(&a)
_NORMAL_(&a.)
_NORMAL_(&(a))
_NORMAL_(&a[1])
_NORMAL_(a[1])
_NORMAL_("['']")

? '< ( ) > SMART'
_SMART_(a)
_SMART_("a")
_SMART_('a')
_SMART_(["'a'"])
_SMART_(&a.1)
_SMART_(&a)
_SMART_(&a.)
_SMART_(&(a))
_SMART_(&a[1])
_SMART_(a[1])
_SMART_("['']")

? '# < > DUMB'
_DUMB_(a)
_DUMB_("a")
_DUMB_('a')
_DUMB_(["'a'"])
_DUMB_(&a.1)
_DUMB_(&a)
_DUMB_(&a.)
_DUMB_(&(a))
_DUMB_(&a[1])
_DUMB_(a[1])
_DUMB_("['']")

? "< > REGULAR list"
_REGULAR_L(a,"a",'a',["'a'"],"['a']",'["a"]',&a.1,&a,&a.,&a.  ,&(a),&a[1],&a.[1],&a.  [2],&a&a, &a.a)
? "< > NORMAL list"
_NORMAL_L(a,"a",'a',["'a'"],"['a']",'["a"]',&a.1,&a,&a.,&a.  ,&(a),&a[1],&a.[1],&a.  [2],&a&a, &.a, &a.a)
? "< > SMART list"
_SMART_L(a,"a",'a',["'a'"],"['a']",'["a"]',&a.1,&a,&a.,&a.  ,&(a),&a[1],&a.[1],&a.  [2],&a&a, &.a, &a.a)
? "< > DUMB list"
_DUMB_L(a,"a",'a',["'a'"],"['a']",'["a"]',&a.1,&a,&a.,&a.  ,&(a),&a[1],&a.[1],&a.  [2],&a&a, &.a, &a.a)

RETURN