2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-17 12:30:48 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2006-09-17 09:05:43 +00:00
|
|
|
|
2017-10-09 17:04:39 +03:00
|
|
|
#include <runtime.hxx>
|
|
|
|
#include <rtlproto.hxx>
|
|
|
|
#include <errobject.hxx>
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
|
2011-08-27 21:37:14 +02:00
|
|
|
// Properties and methods lay the return value down at Get (bWrite = sal_False)
|
|
|
|
// at the element 0 of the Argv; at Put (bWrite = sal_True) the value from
|
|
|
|
// element 0 is stored.
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2021-03-08 12:29:39 +03:00
|
|
|
void SbRtl_Erl(StarBASIC*, SbxArray& rPar, bool) { rPar.Get(0)->PutLong(StarBASIC::GetErl()); }
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2017-07-03 21:10:28 +02:00
|
|
|
void SbRtl_Err(StarBASIC *, SbxArray & rPar, bool bWrite)
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2010-05-07 10:54:26 +01:00
|
|
|
if( SbiRuntime::isVBAEnabled() )
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2021-03-08 12:29:39 +03:00
|
|
|
rPar.Get(0)->PutObject(SbxErrObject::getErrObject().get());
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
|
|
|
else
|
2010-05-07 10:54:26 +01:00
|
|
|
{
|
|
|
|
if( bWrite )
|
|
|
|
{
|
2021-03-08 12:29:39 +03:00
|
|
|
sal_Int32 nVal = rPar.Get(0)->GetLong();
|
2017-08-16 16:27:55 +02:00
|
|
|
if( nVal <= 65535 )
|
2018-01-12 20:29:14 +01:00
|
|
|
StarBASIC::Error( StarBASIC::GetSfxFromVBError( static_cast<sal_uInt16>(nVal) ) );
|
2010-05-07 10:54:26 +01:00
|
|
|
}
|
|
|
|
else
|
2021-03-08 12:29:39 +03:00
|
|
|
rPar.Get(0)->PutLong(StarBASIC::GetVBErrorCode(StarBASIC::GetErrBasic()));
|
2010-05-07 10:54:26 +01:00
|
|
|
}
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
|
|
|
|
2017-07-03 21:10:28 +02:00
|
|
|
void SbRtl_Empty(StarBASIC *, SbxArray &, bool) {}
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2017-07-03 21:10:28 +02:00
|
|
|
void SbRtl_Nothing(StarBASIC *, SbxArray & rPar, bool)
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2011-11-24 23:56:22 -08:00
|
|
|
// return an empty object
|
2021-03-08 12:29:39 +03:00
|
|
|
rPar.Get(0)->PutObject(nullptr);
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
|
|
|
|
2017-07-03 21:10:28 +02:00
|
|
|
void SbRtl_Null(StarBASIC *, SbxArray & rPar, bool)
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2011-08-27 21:37:14 +02:00
|
|
|
// returns an empty object-variable
|
2021-03-08 12:29:39 +03:00
|
|
|
rPar.Get(0)->PutNull();
|
|
|
|
}
|
|
|
|
|
2021-11-18 17:43:46 +03:00
|
|
|
void SbRtl_PI(StarBASIC*, SbxArray& rPar, bool) { rPar.Get(0)->PutDouble(M_PI); }
|
2021-03-08 12:29:39 +03:00
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|