source/QtTest: updated

source/QtTest: updated

Modified:
source/QtTest/QTestEventList.prg

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
#endif

CLASS QTestEventList

   DATA pointer
   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD addDelay
   METHOD addKeyClick1
   METHOD addKeyClick2
   METHOD addKeyClick
   METHOD addKeyClicks
   METHOD addKeyPress1
   METHOD addKeyPress2
   METHOD addKeyPress
   METHOD addKeyRelease1
   METHOD addKeyRelease2
   METHOD addKeyRelease
   METHOD addMouseClick
   METHOD addMouseDClick
   METHOD addMouseMove
   METHOD addMousePress
   METHOD addMouseRelease
   METHOD clear
   METHOD simulate

   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject() CLASS QTestEventList
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QtTest/QTestEventList>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"

/*
QTestEventList ()
*/
void QTestEventList_new1()
{
  QTestEventList * o = new QTestEventList();
  _qt4xhb_returnNewObject( o, true );
}

/*
QTestEventList ( const QTestEventList & other )
*/
void QTestEventList_new2()
{
  QTestEventList * o = new QTestEventList( *PQTESTEVENTLIST(1) );
  _qt4xhb_returnNewObject( o, true );
}

//[1]QTestEventList ()
//[2]QTestEventList ( const QTestEventList & other )

HB_FUNC_STATIC( QTESTEVENTLIST_NEW )
{
  if( ISNUMPAR(0) )
  {
    QTestEventList_new1();
  }
  else if( ISNUMPAR(1) && ISQTESTEVENTLIST(1) )
  {
    QTestEventList_new2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QTESTEVENTLIST_DELETE )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addDelay ( int msecs )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDDELAY )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->addDelay( PINT(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyClick ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYCLICK1 )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyClick( (Qt::Key) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyClick ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYCLICK2 )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyClick( PCHAR(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

//[1]void addKeyClick ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
//[2]void addKeyClick ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )

HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYCLICK )
{
  if( ISBETWEEN(1,3) && ISNUM(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYCLICK1 );
  }
  else if( ISBETWEEN(1,3) && ISCHAR(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYCLICK2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
void addKeyClicks ( const QString & keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYCLICKS )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISCHAR(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyClicks( PQSTRING(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyPress ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYPRESS1 )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyPress( (Qt::Key) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyPress ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYPRESS2 )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyPress( PCHAR(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

//[1]void addKeyPress ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
//[2]void addKeyPress ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )

HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYPRESS )
{
  if( ISBETWEEN(1,3) && ISNUM(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYPRESS1 );
  }
  else if( ISBETWEEN(1,3) && ISCHAR(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYPRESS2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
void addKeyRelease ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYRELEASE1 )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyRelease( (Qt::Key) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyRelease ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYRELEASE2 )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyRelease( PCHAR(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

//[1]void addKeyRelease ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
//[2]void addKeyRelease ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )

HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYRELEASE )
{
  if( ISBETWEEN(1,3) && ISNUM(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYRELEASE1 );
  }
  else if( ISBETWEEN(1,3) && ISCHAR(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYRELEASE2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
void addMouseClick ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSECLICK )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,4) && ISNUM(1) && ISOPTNUM(2) && (ISQPOINT(3)||ISNIL(3)) && ISOPTNUM(4) )
    {
#endif
      obj->addMouseClick( (Qt::MouseButton) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) 0 : (Qt::KeyboardModifiers) hb_parni(2), ISNIL(3)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(3), OPINT(4,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addMouseDClick ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSEDCLICK )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,4) && ISNUM(1) && ISOPTNUM(2) && (ISQPOINT(3)||ISNIL(3)) && ISOPTNUM(4) )
    {
#endif
      obj->addMouseDClick( (Qt::MouseButton) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) 0 : (Qt::KeyboardModifiers) hb_parni(2), ISNIL(3)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(3), OPINT(4,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addMouseMove ( QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSEMOVE )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,2) && (ISQPOINT(1)||ISNIL(1)) && ISOPTNUM(2) )
    {
#endif
      obj->addMouseMove( ISNIL(1)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(1), OPINT(2,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addMousePress ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSEPRESS )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,4) && ISNUM(1) && ISOPTNUM(2) && (ISQPOINT(3)||ISNIL(3)) && ISOPTNUM(4) )
    {
#endif
      obj->addMousePress( (Qt::MouseButton) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) 0 : (Qt::KeyboardModifiers) hb_parni(2), ISNIL(3)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(3), OPINT(4,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addMouseRelease ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSERELEASE )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,4) && ISNUM(1) && ISOPTNUM(2) && (ISQPOINT(3)||ISNIL(3)) && ISOPTNUM(4) )
    {
#endif
      obj->addMouseRelease( (Qt::MouseButton) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) 0 : (Qt::KeyboardModifiers) hb_parni(2), ISNIL(3)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(3), OPINT(4,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void clear ()
*/
HB_FUNC_STATIC( QTESTEVENTLIST_CLEAR )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->clear();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void simulate ( QWidget * w )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_SIMULATE )
{
  QTestEventList * obj = (QTestEventList *) _qt4xhb_itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQWIDGET(1) )
    {
#endif
      obj->simulate( PQWIDGET(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

HB_FUNC_STATIC( QTESTEVENTLIST_NEWFROM )
{
  PHB_ITEM self = hb_stackSelfItem();

  if( hb_pcount() == 1 && ISOBJECT(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else if( hb_pcount() == 1 && ISPOINTER(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }

  hb_itemReturn( self );
}

HB_FUNC_STATIC( QTESTEVENTLIST_NEWFROMOBJECT )
{
  HB_FUNC_EXEC( QTESTEVENTLIST_NEWFROM );
}

HB_FUNC_STATIC( QTESTEVENTLIST_NEWFROMPOINTER )
{
  HB_FUNC_EXEC( QTESTEVENTLIST_NEWFROM );
}

HB_FUNC_STATIC( QTESTEVENTLIST_SELFDESTRUCTION )
{
  hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) );
}

HB_FUNC_STATIC( QTESTEVENTLIST_SETSELFDESTRUCTION )
{
  PHB_ITEM self = hb_stackSelfItem();

  if( hb_pcount() == 1 && ISLOG(1) )
  {
    PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }

  hb_itemReturn( self );
}

#pragma ENDDUMP

/*

  Qt4xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 4

  Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT4XHB_NO_REQUESTS
#endif

CLASS QTestEventList

   DATA pointer
   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD addDelay
   METHOD addKeyClick1
   METHOD addKeyClick2
   METHOD addKeyClick
   METHOD addKeyClicks
   METHOD addKeyPress1
   METHOD addKeyPress2
   METHOD addKeyPress
   METHOD addKeyRelease1
   METHOD addKeyRelease2
   METHOD addKeyRelease
   METHOD addMouseClick
   METHOD addMouseDClick
   METHOD addMouseMove
   METHOD addMousePress
   METHOD addMouseRelease
   METHOD clear
   METHOD simulate

   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject() CLASS QTestEventList
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QtTest/QTestEventList>

#include "qt4xhb_common.h"
#include "qt4xhb_macros.h"
#include "qt4xhb_utils.h"

/*
QTestEventList ()
*/
void QTestEventList_new1()
{
  QTestEventList * o = new QTestEventList();
  _qt4xhb_returnNewObject( o, true );
}

/*
QTestEventList ( const QTestEventList & other )
*/
void QTestEventList_new2()
{
  QTestEventList * o = new QTestEventList( *PQTESTEVENTLIST(1) );
  _qt4xhb_returnNewObject( o, true );
}

//[1]QTestEventList ()
//[2]QTestEventList ( const QTestEventList & other )

HB_FUNC_STATIC( QTESTEVENTLIST_NEW )
{
  if( ISNUMPAR(0) )
  {
    QTestEventList_new1();
  }
  else if( ISNUMPAR(1) && ISQTESTEVENTLIST(1) )
  {
    QTestEventList_new2();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QTESTEVENTLIST_DELETE )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addDelay ( int msecs )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDDELAY )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->addDelay( PINT(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyClick ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYCLICK1 )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyClick( (Qt::Key) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyClick ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYCLICK2 )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyClick( PCHAR(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

//[1]void addKeyClick ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
//[2]void addKeyClick ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )

HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYCLICK )
{
  if( ISBETWEEN(1,3) && ISNUM(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYCLICK1 );
  }
  else if( ISBETWEEN(1,3) && ISCHAR(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYCLICK2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
void addKeyClicks ( const QString & keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYCLICKS )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISCHAR(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyClicks( PQSTRING(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyPress ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYPRESS1 )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyPress( (Qt::Key) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyPress ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYPRESS2 )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyPress( PCHAR(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

//[1]void addKeyPress ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
//[2]void addKeyPress ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )

HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYPRESS )
{
  if( ISBETWEEN(1,3) && ISNUM(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYPRESS1 );
  }
  else if( ISBETWEEN(1,3) && ISCHAR(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYPRESS2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
void addKeyRelease ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYRELEASE1 )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyRelease( (Qt::Key) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addKeyRelease ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYRELEASE2 )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,3) && ISNUM(1) && ISOPTNUM(2) && ISOPTNUM(3) )
    {
#endif
      obj->addKeyRelease( PCHAR(1), ISNIL(2)? (Qt::KeyboardModifiers) Qt::NoModifier : (Qt::KeyboardModifiers) hb_parni(2), OPINT(3,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

//[1]void addKeyRelease ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )
//[2]void addKeyRelease ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 )

HB_FUNC_STATIC( QTESTEVENTLIST_ADDKEYRELEASE )
{
  if( ISBETWEEN(1,3) && ISNUM(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYRELEASE1 );
  }
  else if( ISBETWEEN(1,3) && ISCHAR(1) && (ISNUM(2)||ISNIL(2)) && (ISNUM(3)||ISNIL(3)) )
  {
    HB_FUNC_EXEC( QTESTEVENTLIST_ADDKEYRELEASE2 );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

/*
void addMouseClick ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSECLICK )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,4) && ISNUM(1) && ISOPTNUM(2) && (ISQPOINT(3)||ISNIL(3)) && ISOPTNUM(4) )
    {
#endif
      obj->addMouseClick( (Qt::MouseButton) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) 0 : (Qt::KeyboardModifiers) hb_parni(2), ISNIL(3)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(3), OPINT(4,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addMouseDClick ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSEDCLICK )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,4) && ISNUM(1) && ISOPTNUM(2) && (ISQPOINT(3)||ISNIL(3)) && ISOPTNUM(4) )
    {
#endif
      obj->addMouseDClick( (Qt::MouseButton) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) 0 : (Qt::KeyboardModifiers) hb_parni(2), ISNIL(3)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(3), OPINT(4,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addMouseMove ( QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSEMOVE )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(0,2) && (ISQPOINT(1)||ISNIL(1)) && ISOPTNUM(2) )
    {
#endif
      obj->addMouseMove( ISNIL(1)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(1), OPINT(2,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addMousePress ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSEPRESS )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,4) && ISNUM(1) && ISOPTNUM(2) && (ISQPOINT(3)||ISNIL(3)) && ISOPTNUM(4) )
    {
#endif
      obj->addMousePress( (Qt::MouseButton) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) 0 : (Qt::KeyboardModifiers) hb_parni(2), ISNIL(3)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(3), OPINT(4,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void addMouseRelease ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint(), int delay = -1 )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_ADDMOUSERELEASE )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISBETWEEN(1,4) && ISNUM(1) && ISOPTNUM(2) && (ISQPOINT(3)||ISNIL(3)) && ISOPTNUM(4) )
    {
#endif
      obj->addMouseRelease( (Qt::MouseButton) hb_parni(1), ISNIL(2)? (Qt::KeyboardModifiers) 0 : (Qt::KeyboardModifiers) hb_parni(2), ISNIL(3)? QPoint() : *(QPoint *) _qt4xhb_itemGetPtr(3), OPINT(4,-1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void clear ()
*/
HB_FUNC_STATIC( QTESTEVENTLIST_CLEAR )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      obj->clear();
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

/*
void simulate ( QWidget * w )
*/
HB_FUNC_STATIC( QTESTEVENTLIST_SIMULATE )
{
  QTestEventList * obj = (QTestEventList *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );

  if( obj )
  {
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISQWIDGET(1) )
    {
#endif
      obj->simulate( PQWIDGET(1) );
#ifndef QT4XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
}

HB_FUNC_STATIC( QTESTEVENTLIST_NEWFROM )
{
  PHB_ITEM self = hb_stackSelfItem();

  if( hb_pcount() == 1 && ISOBJECT(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else if( hb_pcount() == 1 && ISPOINTER(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }

  hb_itemReturn( self );
}

HB_FUNC_STATIC( QTESTEVENTLIST_NEWFROMOBJECT )
{
  HB_FUNC_EXEC( QTESTEVENTLIST_NEWFROM );
}

HB_FUNC_STATIC( QTESTEVENTLIST_NEWFROMPOINTER )
{
  HB_FUNC_EXEC( QTESTEVENTLIST_NEWFROM );
}

HB_FUNC_STATIC( QTESTEVENTLIST_SELFDESTRUCTION )
{
  hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) );
}

HB_FUNC_STATIC( QTESTEVENTLIST_SETSELFDESTRUCTION )
{
  PHB_ITEM self = hb_stackSelfItem();

  if( hb_pcount() == 1 && ISLOG(1) )
  {
    PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }

  hb_itemReturn( self );
}

#pragma ENDDUMP


[Runtime] Fixes #1099

[Runtime] Fixes #1099

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
// Most of these settings will Get and Set properties of the Runtime.State class
#include "GetSet.xh"

USING XSharp

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setamext/*" />
FUNCTION SetAMExt() AS STRING
    GETSTATE STRING Set.AmExt

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setamext/*" />
FUNCTION SetAMExt(cAMExt AS STRING) AS STRING
    SETSTATE STRING Set.AmExt cAMExt

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setampm/*" />
FUNCTION SetAmPm() AS LOGIC
    GETSTATE LOGIC Set.AmPm

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setampm/*" />
FUNCTION SetAmPm(lNewSetting AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.AmPm lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setansi/*" />
FUNCTION SetAnsi() AS LOGIC
    RETURN RuntimeState.Ansi

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setansi/*" />
FUNCTION SetAnsi(lNewSetting AS LOGIC) AS LOGIC
    LOCAL lOld := RuntimeState.Ansi AS LOGIC
    RuntimeState.Ansi := lNewSetting
    // Keep charset in sync with Ansi
    RuntimeState.SetValue<LONG>(Set.CharSet, IIF (lNewSetting, 0, 1))
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setbeep/*" />
FUNCTION SetBeep() AS LOGIC
    GETSTATE LOGIC Set.Bell

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setbeep/*" />
FUNCTION SetBeep(lNewSetting AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.Bell lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcentury/*" />
FUNCTION SetCentury() AS LOGIC
    RETURN RuntimeState.Century

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcentury/*" />
FUNCTION SetCentury(lNewSetting AS LOGIC) AS LOGIC
    LOCAL lOld AS LOGIC
    lOld := RuntimeState.Century
    IF lOld != lNewSetting
        VAR cFormat := XSharp.RuntimeState.DateFormat

        IF lNewSetting
            IF ! cFormat:Contains("YYYY")
                cFormat := cFormat:Replace( "YY", "YYYY" )
            ENDIF
        ELSE
            IF cFormat:Contains("YYYY")
                cFormat := cFormat:Replace( "YYYY", "YY" )
            ENDIF
        ENDIF

        SetDateFormat( cFormat )

    ENDIF
    RETURN lOld

FUNCTION SetCompatible() AS LOGIC
    RETURN RuntimeState.Compatible

FUNCTION SetCompatible(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld := RuntimeState.Compatible
    RuntimeState.Compatible := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcpu/*" />
FUNCTION SetCpu() AS DWORD
    GETSTATE DWORD Set.Cpu

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcpu/*" />
FUNCTION SetCpu(nNewSetting AS DWORD) AS DWORD
    SETSTATE DWORD Set.Cpu nNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdatecountry/*" />
FUNCTION SetDateCountry() AS DWORD
    RETURN RuntimeState.DateCountry

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdatecountry/*" />
FUNCTION SetDateCountry(dwNewSetting AS DWORD) AS DWORD
    //	setstate DWORD Set.DATECOUNTRY nNewSetting
    LOCAL dwOld := RuntimeState.DateCountry AS DWORD
    RuntimeState.DateCountry := dwNewSetting
    RETURN dwOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/getdateformat/*" />
FUNCTION GetDateFormat() AS STRING
    GETSTATE STRING Set.DateFormat

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdateformat/*" />
FUNCTION SetDateFormat(cNewSetting AS STRING) AS STRING
    LOCAL cOld AS STRING
    // Changing Dateformat also changes DateCountry and Century
    cOld := RuntimeState.DateFormat
    RuntimeState.DateFormat := cNewSetting
    RETURN cOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdecimal/*" />
FUNCTION SetDecimal() AS DWORD
    RETURN RuntimeState.Decimals

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdecimal/*" />
FUNCTION SetDecimal(nNewSetting AS DWORD) AS DWORD
    VAR nOld := RuntimeState.Decimals
    RuntimeState.Decimals := nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdecimalsep/*" />
FUNCTION SetDecimalSep() AS DWORD
    RETURN RuntimeState.DecimalSep

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdecimalsep/*" />
FUNCTION SetDecimalSep(nNewSetting AS DWORD) AS DWORD
    LOCAL oCulture AS System.Globalization.CultureInfo
    VAR nOld := RuntimeState.DecimalSep
    oCulture := (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread:CurrentCulture:Clone()
    oCulture:NumberFormat:NumberDecimalSeparator := ((CHAR)nNewSetting):ToString()
    System.Threading.Thread.CurrentThread:CurrentCulture := oCulture
    RuntimeState.DecimalSep := nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdefault/*" />
FUNCTION SetDefault() AS STRING
    GETSTATE STRING Set.Default

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdefault/*" />
FUNCTION SetDefault(cPathSpec AS STRING) AS STRING
    SetPathArray(NULL)
    IF XSharp.RuntimeState.Dialect == XSharpDialect.FoxPro
        VAR cTemp := cPathSpec:Trim()
        IF cTemp:EndsWith(System.IO.Path.DirectorySeparatorChar:ToString())
            cTemp := cTemp:Substring(0, cTemp:Length-1)
        ENDIF
        IF ! System.IO.Directory.Exists(cTemp)
            var err := Error.VOError(EG_ARG, __FUNCTION__, nameof(cPathSpec),1, <OBJECT>{cPathSpec})
            err:Description := "Directory not found: '"+cPathSpec+"'"
            THROW err
        ENDIF
    ELSE
        IF cPathSpec:Length > 0
            var cLast := cPathSpec[cPathSpec:Length-1]
            SWITCH cLast
            CASE c':'
            CASE c'\\'
            CASE c'\/'
                NOP
            OTHERWISE
                cPathSpec += System.IO.Path.DirectorySeparatorChar:ToString()
            END SWITCH
        ENDIF

    ENDIF
    SETSTATE STRING Set.Default  cPathSpec

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdefaultdir/*" />
FUNCTION SetDefaultDir() AS STRING
    GETSTATE STRING Set.DefaultDir

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdefaultdir/*" />
FUNCTION SetDefaultDir(cPathSpec AS STRING) AS STRING
    SetPathArray(NULL)
    SETSTATE STRING Set.DefaultDir  cPathSpec

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdeleted/*" />
FUNCTION SetDeleted() AS LOGIC
    RETURN RuntimeState.Deleted

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdeleted/*" />
FUNCTION SetDeleted(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld :=  RuntimeState.Deleted
    RuntimeState.Deleted := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdigit/*" />
FUNCTION SetDigit() AS DWORD
    RETURN RuntimeState.Digits

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdigit/*" />
FUNCTION SetDigit(nNewSetting AS DWORD) AS DWORD
    VAR nOld :=  RuntimeState.Digits
    RuntimeState.Digits := nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdigitfixed/*" />
FUNCTION SetDigitFixed() AS LOGIC
    RETURN RuntimeState.DigitsFixed

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdigitfixed/*" />
FUNCTION SetDigitFixed(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld :=  RuntimeState.DigitsFixed
    RuntimeState.DigitsFixed := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setepoch/*" />
FUNCTION SetEpoch() AS DWORD
    RETURN RuntimeState.Epoch

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setepoch/*" />
FUNCTION SetEpoch(nNewSetting AS DWORD) AS DWORD
    LOCAL wYear AS DWORD
    LOCAL wCent AS DWORD
    VAR nOld := RuntimeState.Epoch
    wYear := nNewSetting % 100
    wCent := (( nNewSetting / 100) +1) * 100
    XSharp.RuntimeState.SetValue<DWORD> (Set.EpochYear, wYear)
    XSharp.RuntimeState.SetValue<DWORD> (Set.EpochCent, wCent)
    RuntimeState.Epoch := nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/seterrorlog/*" />
FUNCTION SetErrorLog() AS LOGIC
    GETSTATE LOGIC Set.Errorlog

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/seterrorlog/*" />
FUNCTION SetErrorLog(lNewSetting AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.Errorlog lNewSetting

/// Get the name of the current errorlog file
/// <returns>Current name of the error log file.</returns>
FUNCTION SetErrorLogFile() AS STRING
    GETSTATE STRING Set.ErrorLogFile

/// Set the name of the current errorlog file
/// <param name="cNewSetting">New name of error log file </param>
/// <returns>Previous name of the error log file.</returns>
FUNCTION SetErrorLogFile(cNewSetting AS STRING) AS STRING
    SETSTATE STRING Set.ErrorLogFile cNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setexact/*" />
FUNCTION SetExact() AS LOGIC
    RETURN RuntimeState.Exact

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setexact/*" />
FUNCTION SetExact(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld :=  RuntimeState.Exact
    RuntimeState.Exact := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setexclusive/*" />
FUNCTION SetExclusive() AS LOGIC
    GETSTATE LOGIC Set.Exclusive

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setexclusive/*" />
FUNCTION SetExclusive(lNewSetting AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.Exclusive lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setfieldstore/*" />
FUNCTION SetFieldStore() AS LOGIC
    GETSTATE LOGIC Set.Fieldstore

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setfieldstore/*" />
FUNCTION SetFieldStore(lNewSetting AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.Fieldstore lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setfixed/*" />
FUNCTION SetFixed() AS LOGIC
    RETURN RuntimeState.Fixed

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setfixed/*" />
FUNCTION SetFixed(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld :=  RuntimeState.Fixed
    RuntimeState.Fixed := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setmath/*" />
FUNCTION SetMath() AS DWORD
    GETSTATE DWORD Set.Math

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setmath/*" />
FUNCTION SetMath(nNewSetting AS DWORD) AS DWORD
    SETSTATE DWORD Set.Math nNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setnatdll/*" />
/// <remarks>
/// In Visual Objects the nation DLL is an external DLL. For X# there are no separate
/// nation DLL. The nation support code is integrated in XSharp.Core.DLL.
/// For compatibility you can still use the SetNatDLL() function to switch to another
/// nation module.

/// The available nation modules are (just like in Visual Objects):

/// 	"BRAZIL", "CROATIA", "CZECH852", "CZECH895", "DANISH", "DUTCH", "FINNISH",
/// 	"FRENCH", "GENERIC", "GERMAN", "GERMAN2", "HUNG852", "HUNGCWI", "ITALIAN",
///     "NORWEGN", "POL-ISO", "POL-MAZ", "POL852", "PORT850", "PORT860", "ROMANIA",
/// 	"RUSSIAN", "SERBIA", "SL-W-95", "SL-W-AS7", "SL-W-EE", "SLOV852", "SLOV895",
/// 	"SPANISH", "SWEDISH", "TURKISH", "UK"
///
 You may specify a DLL name with full path. The Runtime will strip the path and extension
/// from the file name and will look for one of the names listed above.

/// The nation DLL name is NOT case sensitive.
///</remarks>

FUNCTION SetNatDLL(cNewDLL AS STRING) AS LOGIC
    LOCAL cBase AS STRING
    _SetNatDLL(cNewDLL)
    cBase := System.IO.Path.GetFileNameWithoutExtension(cNewDLL)
    _SetCollation(cBase)
    RETURN String.Compare(Messages.CurrentLanguageName, cBase, TRUE) == 0

/// <exclude/>
FUNCTION _SetCollation(cBase AS STRING) AS LOGIC
    VAR rm := System.Resources.ResourceManager{ "XSharp.Collations", TYPEOF(Functions):Assembly }
    VAR obj := rm:GetObject(cBase:ToUpper())
    IF obj != NULL
        VAR bytes := obj ASTYPE BYTE[]
        IF bytes != NULL
            XSharp.RuntimeState.CollationTable := bytes
            RETURN TRUE
        ENDIF
    ENDIF
    RETURN FALSE
/// <exclude/>
INTERNAL FUNCTION	_SetNatDLL(cNewDLL AS STRING) AS STRING
    LOCAL cBase AS STRING
    cBase := System.IO.Path.GetFileNameWithoutExtension(cNewDLL)
    Messages.SetCurrentLanguage(cBase)
    SETSTATE STRING Set.NatDLL cNewDLL

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setpath/*" />
FUNCTION SetPath() AS STRING
    GETSTATE STRING Set.Path

/// <exclude/>
FUNCTION _SetDict() AS LOGIC
    GETSTATE LOGIC Set.Dict

/// <exclude/>
FUNCTION _SetDict(lNewSetting AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.Dict lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setpath/*" />
FUNCTION SetPath(cPathList AS STRING) AS STRING
    SetPathArray(NULL)
    SETSTATE STRING Set.Path cPathList

///
/// Return the Path array that is used by the File() function to locate files outside of the current directory.
/// This is a combination of the SetDefault() and SetPath() variables.
/// This may be null if the file function has never been called or never been called for files outside of the current
/// directory.
///
/// <returns>
/// </returns>
FUNCTION SetPathArray() AS STRING[]
    GETSTATE STRING[] Set.Patharray

///
/// Set the Path array that is used by the File() function to locate files outside of the current directory.
/// This is a combination of the SetDefault() and SetPath() variables.
/// This array gets cleared when SetPath() or SetDefault() is called and is initialized the first time File() or a related function
//  is called after the path has been changed.
///
/// <param name="aPath"></param>
/// <returns>
/// </returns>
FUNCTION SetPathArray(aPath AS STRING[]) AS STRING[]
    SETSTATE STRING[] Set.Patharray aPath

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setpmext/*" />
FUNCTION SetPMExt() AS STRING
    GETSTATE STRING Set.PmExt

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setpmext/*" />
FUNCTION SetPMExt(cPMExt AS STRING) AS STRING
    SETSTATE STRING Set.PmExt cPMExt

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setscience/*" />
FUNCTION SetScience() AS LOGIC
    GETSTATE LOGIC Set.Science

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setscience/*" />
FUNCTION SetScience(lNewSetting AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.Science lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setsoftseek/*" />
FUNCTION SetSoftSeek() AS LOGIC
    RETURN RuntimeState.SoftSeek

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setsoftseek/*" />
FUNCTION SetSoftSeek(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld := RuntimeState.SoftSeek
    RuntimeState.SoftSeek := lNewSetting
    RETURN lOld

FUNCTION SetSafety() AS LOGIC
    RETURN RuntimeState.Safety

FUNCTION SetSafety(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld := RuntimeState.Safety
    RuntimeState.Safety := lNewSetting
    RETURN lOld

///
/// Return the setting that determines whether a space is displayed between fields or expressions when you use the ? or ?? command.
///
/// <returns>
/// </returns>
FUNCTION SetSpace() AS LOGIC
    GETSTATE LOGIC Set.Space

///
/// Change the setting that determines whether a space is displayed between fields or expressions when you use the ? or ?? command.
///
/// <param name="lSet"></param>
/// <returns>
/// </returns>
FUNCTION SetSpace(lSet AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.Space lSet

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setthousandsep/*" />
FUNCTION SetThousandSep() AS DWORD
    RETURN RuntimeState.ThousandSep

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setthousandsep/*" />
FUNCTION SetThousandSep(nNewSetting AS DWORD) AS DWORD
    LOCAL oCulture AS System.Globalization.CultureInfo
    VAR nOld := RuntimeState.ThousandSep
    oCulture := (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread:CurrentCulture:Clone()
    oCulture:NumberFormat:NumberGroupSeparator := ((CHAR)nNewSetting):ToString()
    System.Threading.Thread.CurrentThread:CurrentCulture := oCulture
    RuntimeState.ThousandSep :=  nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/settimesep/*" />
FUNCTION SetTimeSep() AS DWORD
    GETSTATE DWORD Set.Timesep

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/settimesep/*" />
FUNCTION SetTimeSep(dwNewSetting AS DWORD) AS DWORD
    SETSTATE DWORD Set.Timesep dwNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setunique/*" />
FUNCTION SetUnique() AS LOGIC
    RETURN RuntimeState.Unique

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setunique/*" />
FUNCTION SetUnique(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld := RuntimeState.Unique
    RuntimeState.Unique := lNewSetting
    RETURN lOld

///
///
/// <returns>
/// </returns>
FUNCTION SetYield() AS LOGIC
    GETSTATE LOGIC Set.Yield

///
///
/// <param name="lSet"></param>
/// <returns>
/// </returns>
FUNCTION SetYield(lSet AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.Yield lSet

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/errorlevel/*" />
FUNCTION ErrorLevel(dwNewSetting AS DWORD) AS DWORD
    SETSTATE DWORD Set.ErrorLevel dwNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/errorlevel/*" />
FUNCTION ErrorLevel() AS DWORD
    GETSTATE DWORD Set.ErrorLevel

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setinternational/*" />
FUNCTION SetInternational() AS STRING
    RETURN RuntimeState.International:ToString():ToUpper()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setinternational/*" />
/// <remarks>
/// SetInternational() allows XSharp apps to operate in different international modes.
/// The "CLIPPER" mode is provided for compatibility with CA-Clipper applications and uses an
/// internationalization routine defined in the nation module.

/// The "Windows" mode uses international services provided by Windows.
/// When you set this mode several settings will be changed
/// <list type="table">
/// <listheader>
/// <term>Setting</term> <description>Initial value in CLIPPER mode</description>
/// </listheader>
///	<item><term>SetAmExt</term> <description>Empty String</description></item>
/// <item><term>SetPmExt</term> <description>Empty String</description></item>
/// <item><term>SetAmPm</term> <description>FALSE (24 hour format)</description></item>
/// <item><term>SetCentury</term> <description>FALSE</description></item>
/// <item><term>SetDateCountry</term> <description>American (1)</description></item>
/// <item><term>SetDateFormat</term> <description>mm/dd/yy</description></item>
/// <item><term>SetDecimal</term> <description>2</description></item>
/// <item><term>SetDecimalSep</term> <description>Period (.)</description></item>
/// <item><term>SetThousandSep</term> <description>Comma (,)</description></item>
/// <item><term>SetTimeSep</term> <description>Colon(:)</description></item>
/// </list>
/// </remarks>
FUNCTION SetInternational(symNewSetting AS STRING) AS STRING
    LOCAL cOld AS STRING
    cOld := RuntimeState.International:ToString():ToUpper()
    SWITCH symNewSetting:ToUpper()
        CASE "CLIPPER"
        CASE "XPP"
            RuntimeState.GetInstance()._SetInternationalClipper()
        CASE "WINDOWS"
        CASE "UNICODE"
        CASE "ORDINAL"
            RuntimeState.GetInstance()._SetInternationalWindows()
        OTHERWISE
            THROW Error.ArgumentError(__ENTITY__, NAMEOF(symNewSetting), "Unsupported international mode: "+ symNewSetting)
    END SWITCH
    RETURN cOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcollation/*" />
/// <remarks>
/// <include file="CoreComments.xml" path="Comments/Collation/*" />
/// </remarks>
FUNCTION SetCollation() AS STRING
    RETURN RuntimeState.CollationMode:ToString():ToUpper()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcollation/*" />
/// <remarks>
/// <include file="CoreComments.xml" path="Comments/Collation/*" />
/// </remarks>
/// <returns>The current setting, either "Windows" (the default),  "Clipper", "Unicode" or "Ordinal" </returns>
/// <param name="cCollation">The collation mode to use. The available modes are "Windows" (the default),  "Clipper", "Unicode" and "Ordinal". </param>
FUNCTION SetCollation(symNewSetting AS STRING)  AS STRING
    LOCAL cOld AS STRING
    cOld := RuntimeState.CollationMode:ToString():ToUpper()
    SWITCH symNewSetting:ToUpper()
        CASE "CLIPPER"
            RuntimeState.CollationMode := CollationMode.Clipper
        CASE "XPP"
            RuntimeState.CollationMode := CollationMode.Xpp
        CASE "WINDOWS"
            RuntimeState.CollationMode := CollationMode.Windows
        CASE "UNICODE"
            RuntimeState.CollationMode := CollationMode.Unicode
        CASE "ORDINAL"
            RuntimeState.CollationMode := CollationMode.Ordinal
        OTHERWISE
            THROW Error.ArgumentError(__ENTITY__, NAMEOF(symNewSetting), "Unsupported collation mode: "+symNewSetting)
    END SWITCH
    RETURN cOld

FUNCTION SetTimeFormat(timeformat AS STRING) AS VOID
    RuntimeState.GetInstance():_SetTimeFormat(timeformat)

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
// Most of these settings will Get and Set properties of the Runtime.State class
#include "GetSet.xh"

USING XSharp

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setamext/*" />
FUNCTION SetAMExt() AS STRING
	GETSTATE STRING Set.AmExt

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setamext/*" />
FUNCTION SetAMExt(cAMExt AS STRING) AS STRING
	SETSTATE STRING Set.AmExt cAMExt

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setampm/*" />
FUNCTION SetAmPm() AS LOGIC
	GETSTATE LOGIC Set.AmPm

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setampm/*" />
FUNCTION SetAmPm(lNewSetting AS LOGIC) AS LOGIC
	SETSTATE LOGIC Set.AmPm lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setansi/*" />
FUNCTION SetAnsi() AS LOGIC
	RETURN RuntimeState.Ansi

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setansi/*" />
FUNCTION SetAnsi(lNewSetting AS LOGIC) AS LOGIC
	LOCAL lOld := RuntimeState.Ansi AS LOGIC
	RuntimeState.Ansi := lNewSetting
    // Keep charset in sync with Ansi
    RuntimeState.SetValue<LONG>(Set.CharSet, IIF (lNewSetting, 0, 1))
	RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setbeep/*" />
FUNCTION SetBeep() AS LOGIC
	GETSTATE LOGIC Set.Bell

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setbeep/*" />
FUNCTION SetBeep(lNewSetting AS LOGIC) AS LOGIC
	SETSTATE LOGIC Set.Bell lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcentury/*" />
FUNCTION SetCentury() AS LOGIC
	RETURN RuntimeState.Century

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcentury/*" />
FUNCTION SetCentury(lNewSetting AS LOGIC) AS LOGIC
	LOCAL lOld AS LOGIC
    lOld := RuntimeState.Century
    IF lOld != lNewSetting
      VAR cFormat := XSharp.RuntimeState.DateFormat

      IF lNewSetting
        IF ! cFormat:Contains("YYYY")
            cFormat := cFormat:Replace( "YY", "YYYY" )
        ENDIF
      ELSE
        IF cFormat:Contains("YYYY")
            cFormat := cFormat:Replace( "YYYY", "YY" )
        ENDIF
      ENDIF

      SetDateFormat( cFormat )

    ENDIF
    RETURN lOld

FUNCTION SetCompatible() AS LOGIC
	RETURN RuntimeState.Compatible

FUNCTION SetCompatible(lNewSetting AS LOGIC) AS LOGIC
	VAR lOld := RuntimeState.Compatible
    RuntimeState.Compatible := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcpu/*" />
FUNCTION SetCpu() AS DWORD
	GETSTATE DWORD Set.Cpu

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcpu/*" />
FUNCTION SetCpu(nNewSetting AS DWORD) AS DWORD
   	SETSTATE DWORD Set.Cpu nNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdatecountry/*" />
FUNCTION SetDateCountry() AS DWORD
	RETURN RuntimeState.DateCountry

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdatecountry/*" />
FUNCTION SetDateCountry(dwNewSetting AS DWORD) AS DWORD
//	setstate DWORD Set.DATECOUNTRY nNewSetting
	LOCAL dwOld := RuntimeState.DateCountry AS DWORD
	RuntimeState.DateCountry := dwNewSetting
	RETURN dwOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/getdateformat/*" />
FUNCTION GetDateFormat() AS STRING
	GETSTATE STRING Set.DateFormat

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdateformat/*" />
FUNCTION SetDateFormat(cNewSetting AS STRING) AS STRING
	LOCAL cOld AS STRING
	// Changing Dateformat also changes DateCountry and Century
	cOld := RuntimeState.DateFormat
	RuntimeState.DateFormat := cNewSetting
	RETURN cOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdecimal/*" />
FUNCTION SetDecimal() AS DWORD
	RETURN RuntimeState.Decimals

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdecimal/*" />
FUNCTION SetDecimal(nNewSetting AS DWORD) AS DWORD
	VAR nOld := RuntimeState.Decimals
    RuntimeState.Decimals := nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdecimalsep/*" />
FUNCTION SetDecimalSep() AS DWORD
    RETURN RuntimeState.DecimalSep

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdecimalsep/*" />
FUNCTION SetDecimalSep(nNewSetting AS DWORD) AS DWORD
	LOCAL oCulture AS System.Globalization.CultureInfo
    VAR nOld := RuntimeState.DecimalSep
	oCulture := (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread:CurrentCulture:Clone()
	oCulture:NumberFormat:NumberDecimalSeparator := ((CHAR)nNewSetting):ToString()
	System.Threading.Thread.CurrentThread:CurrentCulture := oCulture
	RuntimeState.DecimalSep := nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdefault/*" />
FUNCTION SetDefault() AS STRING
	GETSTATE STRING Set.Default

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdefault/*" />
FUNCTION SetDefault(cPathSpec AS STRING) AS STRING
	SetPathArray(NULL)
    IF XSharp.RuntimeState.Dialect == XSharpDialect.FoxPro
        VAR cTemp := cPathSpec:Trim()
        IF cTemp:EndsWith(System.IO.Path.DirectorySeparatorChar:ToString())
            cTemp := cTemp:Substring(0, cTemp:Length-1)
        ENDIF
        IF ! System.IO.Directory.Exists(cTemp)
            var err := Error.VOError(EG_ARG, __FUNCTION__, nameof(cPathSpec),1, <OBJECT>{cPathSpec})
            err:Description := "Directory not found: '"+cPathSpec+"'"
            THROW err
        ENDIF
    ENDIF
	SETSTATE STRING Set.Default  cPathSpec

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdefaultdir/*" />
FUNCTION SetDefaultDir() AS STRING
	GETSTATE STRING Set.DefaultDir

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdefaultdir/*" />
FUNCTION SetDefaultDir(cPathSpec AS STRING) AS STRING
	SetPathArray(NULL)
	SETSTATE STRING Set.DefaultDir  cPathSpec

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdeleted/*" />
FUNCTION SetDeleted() AS LOGIC
	RETURN RuntimeState.Deleted

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdeleted/*" />
FUNCTION SetDeleted(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld :=  RuntimeState.Deleted
    RuntimeState.Deleted := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdigit/*" />
FUNCTION SetDigit() AS DWORD
	RETURN RuntimeState.Digits

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdigit/*" />
FUNCTION SetDigit(nNewSetting AS DWORD) AS DWORD
    VAR nOld :=  RuntimeState.Digits
    RuntimeState.Digits := nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdigitfixed/*" />
FUNCTION SetDigitFixed() AS LOGIC
	RETURN RuntimeState.DigitsFixed

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setdigitfixed/*" />
FUNCTION SetDigitFixed(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld :=  RuntimeState.DigitsFixed
    RuntimeState.DigitsFixed := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setepoch/*" />
FUNCTION SetEpoch() AS DWORD
	RETURN RuntimeState.Epoch

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setepoch/*" />
FUNCTION SetEpoch(nNewSetting AS DWORD) AS DWORD
	LOCAL wYear AS DWORD
	LOCAL wCent AS DWORD
    VAR nOld := RuntimeState.Epoch
	wYear := nNewSetting % 100
	wCent := (( nNewSetting / 100) +1) * 100
	XSharp.RuntimeState.SetValue<DWORD> (Set.EpochYear, wYear)
	XSharp.RuntimeState.SetValue<DWORD> (Set.EpochCent, wCent)
	RuntimeState.Epoch := nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/seterrorlog/*" />
FUNCTION SetErrorLog() AS LOGIC
	GETSTATE LOGIC Set.Errorlog

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/seterrorlog/*" />
FUNCTION SetErrorLog(lNewSetting AS LOGIC) AS LOGIC
	SETSTATE LOGIC Set.Errorlog lNewSetting

/// Get the name of the current errorlog file
/// <returns>Current name of the error log file.</returns>
FUNCTION SetErrorLogFile() AS STRING
	GETSTATE STRING Set.ErrorLogFile

/// Set the name of the current errorlog file
/// <param name="cNewSetting">New name of error log file </param>
/// <returns>Previous name of the error log file.</returns>
FUNCTION SetErrorLogFile(cNewSetting AS STRING) AS STRING
	SETSTATE STRING Set.ErrorLogFile cNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setexact/*" />
FUNCTION SetExact() AS LOGIC
	RETURN RuntimeState.Exact

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setexact/*" />
FUNCTION SetExact(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld :=  RuntimeState.Exact
    RuntimeState.Exact := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setexclusive/*" />
FUNCTION SetExclusive() AS LOGIC
	GETSTATE LOGIC Set.Exclusive

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setexclusive/*" />
FUNCTION SetExclusive(lNewSetting AS LOGIC) AS LOGIC
	SETSTATE LOGIC Set.Exclusive lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setfieldstore/*" />
FUNCTION SetFieldStore() AS LOGIC
	GETSTATE LOGIC Set.Fieldstore

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setfieldstore/*" />
FUNCTION SetFieldStore(lNewSetting AS LOGIC) AS LOGIC
	SETSTATE LOGIC Set.Fieldstore lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setfixed/*" />
FUNCTION SetFixed() AS LOGIC
	RETURN RuntimeState.Fixed

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setfixed/*" />
FUNCTION SetFixed(lNewSetting AS LOGIC) AS LOGIC
    VAR lOld :=  RuntimeState.Fixed
    RuntimeState.Fixed := lNewSetting
    RETURN lOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setmath/*" />
FUNCTION SetMath() AS DWORD
	GETSTATE DWORD Set.Math

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setmath/*" />
FUNCTION SetMath(nNewSetting AS DWORD) AS DWORD
	SETSTATE DWORD Set.Math nNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setnatdll/*" />
/// <remarks>
/// In Visual Objects the nation DLL is an external DLL. For X# there are no separate
/// nation DLL. The nation support code is integrated in XSharp.Core.DLL.
/// For compatibility you can still use the SetNatDLL() function to switch to another
/// nation module.

/// The available nation modules are (just like in Visual Objects):

/// 	"BRAZIL", "CROATIA", "CZECH852", "CZECH895", "DANISH", "DUTCH", "FINNISH",
/// 	"FRENCH", "GENERIC", "GERMAN", "GERMAN2", "HUNG852", "HUNGCWI", "ITALIAN",
///     "NORWEGN", "POL-ISO", "POL-MAZ", "POL852", "PORT850", "PORT860", "ROMANIA",
/// 	"RUSSIAN", "SERBIA", "SL-W-95", "SL-W-AS7", "SL-W-EE", "SLOV852", "SLOV895",
/// 	"SPANISH", "SWEDISH", "TURKISH", "UK"
///
 You may specify a DLL name with full path. The Runtime will strip the path and extension
/// from the file name and will look for one of the names listed above.

/// The nation DLL name is NOT case sensitive.
///</remarks>

FUNCTION SetNatDLL(cNewDLL AS STRING) AS LOGIC
	LOCAL cBase AS STRING
	_SetNatDLL(cNewDLL)
	cBase := System.IO.Path.GetFileNameWithoutExtension(cNewDLL)
	_SetCollation(cBase)
	RETURN String.Compare(Messages.CurrentLanguageName, cBase, TRUE) == 0

/// <exclude/>
FUNCTION _SetCollation(cBase AS STRING) AS LOGIC
	VAR rm := System.Resources.ResourceManager{ "XSharp.Collations", TYPEOF(Functions):Assembly }
	VAR obj := rm:GetObject(cBase:ToUpper())
	IF obj != NULL
		VAR bytes := obj ASTYPE BYTE[]
		IF bytes != NULL
			XSharp.RuntimeState.CollationTable := bytes
			RETURN TRUE
		ENDIF
	ENDIF
	RETURN FALSE
/// <exclude/>
INTERNAL FUNCTION	_SetNatDLL(cNewDLL AS STRING) AS STRING
	LOCAL cBase AS STRING
	cBase := System.IO.Path.GetFileNameWithoutExtension(cNewDLL)
	Messages.SetCurrentLanguage(cBase)
	SETSTATE STRING Set.NatDLL cNewDLL

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setpath/*" />
FUNCTION SetPath() AS STRING
	GETSTATE STRING Set.Path

/// <exclude/>
FUNCTION _SetDict() AS LOGIC
    GETSTATE LOGIC Set.Dict

/// <exclude/>
FUNCTION _SetDict(lNewSetting AS LOGIC) AS LOGIC
    SETSTATE LOGIC Set.Dict lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setpath/*" />
FUNCTION SetPath(cPathList AS STRING) AS STRING
	SetPathArray(NULL)
	SETSTATE STRING Set.Path cPathList

///
/// Return the Path array that is used by the File() function to locate files outside of the current directory.
/// This is a combination of the SetDefault() and SetPath() variables.
/// This may be null if the file function has never been called or never been called for files outside of the current
/// directory.
///
/// <returns>
/// </returns>
FUNCTION SetPathArray() AS STRING[]
	GETSTATE STRING[] Set.Patharray

///
/// Set the Path array that is used by the File() function to locate files outside of the current directory.
/// This is a combination of the SetDefault() and SetPath() variables.
/// This array gets cleared when SetPath() or SetDefault() is called and is initialized the first time File() or a related function
//  is called after the path has been changed.
///
/// <param name="aPath"></param>
/// <returns>
/// </returns>
FUNCTION SetPathArray(aPath AS STRING[]) AS STRING[]
	SETSTATE STRING[] Set.Patharray aPath

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setpmext/*" />
FUNCTION SetPMExt() AS STRING
	GETSTATE STRING Set.PmExt

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setpmext/*" />
FUNCTION SetPMExt(cPMExt AS STRING) AS STRING
	SETSTATE STRING Set.PmExt cPMExt

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setscience/*" />
FUNCTION SetScience() AS LOGIC
	GETSTATE LOGIC Set.Science

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setscience/*" />
FUNCTION SetScience(lNewSetting AS LOGIC) AS LOGIC
	SETSTATE LOGIC Set.Science lNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setsoftseek/*" />
FUNCTION SetSoftSeek() AS LOGIC
	RETURN RuntimeState.SoftSeek

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setsoftseek/*" />
FUNCTION SetSoftSeek(lNewSetting AS LOGIC) AS LOGIC
	VAR lOld := RuntimeState.SoftSeek
    RuntimeState.SoftSeek := lNewSetting
    RETURN lOld

FUNCTION SetSafety() AS LOGIC
	RETURN RuntimeState.Safety

FUNCTION SetSafety(lNewSetting AS LOGIC) AS LOGIC
	VAR lOld := RuntimeState.Safety
    RuntimeState.Safety := lNewSetting
    RETURN lOld

///
/// Return the setting that determines whether a space is displayed between fields or expressions when you use the ? or ?? command.
///
/// <returns>
/// </returns>
FUNCTION SetSpace() AS LOGIC
	GETSTATE LOGIC Set.Space

///
/// Change the setting that determines whether a space is displayed between fields or expressions when you use the ? or ?? command.
///
/// <param name="lSet"></param>
/// <returns>
/// </returns>
FUNCTION SetSpace(lSet AS LOGIC) AS LOGIC
	SETSTATE LOGIC Set.Space lSet

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setthousandsep/*" />
FUNCTION SetThousandSep() AS DWORD
	RETURN RuntimeState.ThousandSep

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setthousandsep/*" />
FUNCTION SetThousandSep(nNewSetting AS DWORD) AS DWORD
	LOCAL oCulture AS System.Globalization.CultureInfo
    VAR nOld := RuntimeState.ThousandSep
	oCulture := (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread:CurrentCulture:Clone()
	oCulture:NumberFormat:NumberGroupSeparator := ((CHAR)nNewSetting):ToString()
	System.Threading.Thread.CurrentThread:CurrentCulture := oCulture
    RuntimeState.ThousandSep :=  nNewSetting
    RETURN nOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/settimesep/*" />
FUNCTION SetTimeSep() AS DWORD
	GETSTATE DWORD Set.Timesep

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/settimesep/*" />
FUNCTION SetTimeSep(dwNewSetting AS DWORD) AS DWORD
	SETSTATE DWORD Set.Timesep dwNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setunique/*" />
FUNCTION SetUnique() AS LOGIC
	RETURN RuntimeState.Unique

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setunique/*" />
FUNCTION SetUnique(lNewSetting AS LOGIC) AS LOGIC
	VAR lOld := RuntimeState.Unique
    RuntimeState.Unique := lNewSetting
    RETURN lOld

///
///
/// <returns>
/// </returns>
FUNCTION SetYield() AS LOGIC
	GETSTATE LOGIC Set.Yield

///
///
/// <param name="lSet"></param>
/// <returns>
/// </returns>
FUNCTION SetYield(lSet AS LOGIC) AS LOGIC
	SETSTATE LOGIC Set.Yield lSet

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/errorlevel/*" />
FUNCTION ErrorLevel(dwNewSetting AS DWORD) AS DWORD
	SETSTATE DWORD Set.ErrorLevel dwNewSetting

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/errorlevel/*" />
FUNCTION ErrorLevel() AS DWORD
	GETSTATE DWORD Set.ErrorLevel

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setinternational/*" />
FUNCTION SetInternational() AS STRING
	RETURN RuntimeState.International:ToString():ToUpper()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setinternational/*" />
/// <remarks>
/// SetInternational() allows XSharp apps to operate in different international modes.
/// The "CLIPPER" mode is provided for compatibility with CA-Clipper applications and uses an
/// internationalization routine defined in the nation module.

/// The "Windows" mode uses international services provided by Windows.
/// When you set this mode several settings will be changed
/// <list type="table">
/// <listheader>
/// <term>Setting</term> <description>Initial value in CLIPPER mode</description>
/// </listheader>
///	<item><term>SetAmExt</term> <description>Empty String</description></item>
/// <item><term>SetPmExt</term> <description>Empty String</description></item>
/// <item><term>SetAmPm</term> <description>FALSE (24 hour format)</description></item>
/// <item><term>SetCentury</term> <description>FALSE</description></item>
/// <item><term>SetDateCountry</term> <description>American (1)</description></item>
/// <item><term>SetDateFormat</term> <description>mm/dd/yy</description></item>
/// <item><term>SetDecimal</term> <description>2</description></item>
/// <item><term>SetDecimalSep</term> <description>Period (.)</description></item>
/// <item><term>SetThousandSep</term> <description>Comma (,)</description></item>
/// <item><term>SetTimeSep</term> <description>Colon(:)</description></item>
/// </list>
/// </remarks>
FUNCTION SetInternational(symNewSetting AS STRING) AS STRING
	LOCAL cOld AS STRING
	cOld := RuntimeState.International:ToString():ToUpper()
	SWITCH symNewSetting:ToUpper()
	CASE "CLIPPER"
	CASE "XPP"
		RuntimeState.GetInstance()._SetInternationalClipper()
	CASE "WINDOWS"
	CASE "UNICODE"
	CASE "ORDINAL"
		RuntimeState.GetInstance()._SetInternationalWindows()
	OTHERWISE
		THROW Error.ArgumentError(__ENTITY__, NAMEOF(symNewSetting), "Unsupported international mode: "+ symNewSetting)
	END SWITCH
	RETURN cOld

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcollation/*" />
/// <remarks>
/// <include file="CoreComments.xml" path="Comments/Collation/*" />
/// </remarks>
FUNCTION SetCollation() AS STRING
	RETURN RuntimeState.CollationMode:ToString():ToUpper()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/setcollation/*" />
/// <remarks>
/// <include file="CoreComments.xml" path="Comments/Collation/*" />
/// </remarks>
/// <returns>The current setting, either "Windows" (the default),  "Clipper", "Unicode" or "Ordinal" </returns>
/// <param name="cCollation">The collation mode to use. The available modes are "Windows" (the default),  "Clipper", "Unicode" and "Ordinal". </param>
FUNCTION SetCollation(symNewSetting AS STRING)  AS STRING
	LOCAL cOld AS STRING
	cOld := RuntimeState.CollationMode:ToString():ToUpper()
	SWITCH symNewSetting:ToUpper()
	CASE "CLIPPER"
		RuntimeState.CollationMode := CollationMode.Clipper
	CASE "XPP"
		RuntimeState.CollationMode := CollationMode.Xpp
	CASE "WINDOWS"
		RuntimeState.CollationMode := CollationMode.Windows
	CASE "UNICODE"
		RuntimeState.CollationMode := CollationMode.Unicode
	CASE "ORDINAL"
		RuntimeState.CollationMode := CollationMode.Ordinal
	OTHERWISE
		THROW Error.ArgumentError(__ENTITY__, NAMEOF(symNewSetting), "Unsupported collation mode: "+symNewSetting)
	END SWITCH
	RETURN cOld

FUNCTION SetTimeFormat(timeformat AS STRING) AS VOID
    RuntimeState.GetInstance():_SetTimeFormat(timeformat)