Kaydet (Commit) 98f0e0ed authored tarafından Damjan Jovanovic's avatar Damjan Jovanovic Kaydeden (comit) Caolán McNamara

Resolves: #i19221# Print Tab(5); "Hello" does not work

Implement the Tab() function in AOO Basic.

Patch by: me

(cherry picked from commit fa1315d2)

Change-Id: Ifa9843661ce3862347c6351a078ddb207169182a
üst f2996d8f
...@@ -199,6 +199,7 @@ extern RTLFUNC(StrComp); ...@@ -199,6 +199,7 @@ extern RTLFUNC(StrComp);
extern RTLFUNC(String); extern RTLFUNC(String);
extern RTLFUNC(StrReverse); extern RTLFUNC(StrReverse);
extern RTLFUNC(SYD); extern RTLFUNC(SYD);
extern RTLFUNC(Tab);
extern RTLFUNC(Tan); extern RTLFUNC(Tan);
extern RTLFUNC(UCase); extern RTLFUNC(UCase);
extern RTLFUNC(Val); extern RTLFUNC(Val);
......
...@@ -1725,6 +1725,21 @@ RTLFUNC(String) ...@@ -1725,6 +1725,21 @@ RTLFUNC(String)
} }
} }
RTLFUNC(Tab)
{
(void)pBasic;
(void)bWrite;
if ( rPar.Count() < 2 )
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
else
{
OUStringBuffer aStr;
comphelper::string::padToLength(aStr, rPar.Get(1)->GetLong(), '\t');
rPar.Get(0)->PutString(aStr.makeStringAndClear());
}
}
RTLFUNC(Tan) RTLFUNC(Tan)
{ {
(void)pBasic; (void)pBasic;
......
...@@ -603,7 +603,7 @@ static Methods aMethods[] = { ...@@ -603,7 +603,7 @@ static Methods aMethods[] = {
{ "Switch", SbxVARIANT, 2 | _FUNCTION, RTLNAME(Switch),0 }, { "Switch", SbxVARIANT, 2 | _FUNCTION, RTLNAME(Switch),0 },
{ "Expression", SbxVARIANT, 0,nullptr,0 }, { "Expression", SbxVARIANT, 0,nullptr,0 },
{ "Value", SbxVARIANT, 0,nullptr,0 }, { "Value", SbxVARIANT, 0,nullptr,0 },
{ "Tab", SbxSTRING, 1 | _FUNCTION, RTLNAME(Tab),0 },
{ "Tan", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Tan),0 }, { "Tan", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Tan),0 },
{ "number", SbxDOUBLE, 0,nullptr,0 }, { "number", SbxDOUBLE, 0,nullptr,0 },
{ "Time", SbxVARIANT, _LFUNCTION,RTLNAME(Time),0 }, { "Time", SbxVARIANT, _LFUNCTION,RTLNAME(Time),0 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment