Tags:
create new tag
view all tags

Question

I am a bit confused. I tried to use the following SpreadSheetPlugin code in my sandbox.

%CALC{$INT(08)}%

It returns "ERROR: Illegal octal digit '8', at end of line"

I did some tests and it only returns this error for 09 and 08 so basically this error only happens when either the number 8 or 9 has a leading zero.

The reason they have a leading zero is because I am trying to do a simple calculations using the current days date which is always returned with a leading zero.

Does someone know whats going on? Is this a bug?

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Windows Server 2003 (Indigo Perl)
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Plugins

-- GregGardinier - 08 Sep 2007

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Bug or feature, that is the question. The plugin uses the underlying Perl functions to process functions. In Perl, a leading zero indicates an octal number, hence the error message for illegal octal 08. Octal numbers are in the geek zone, so the plugin should be fixed.

-- PeterThoeny - 09 Sep 2007

Oh, okay thanks. I wound up writing an if statement that removed leading zeros. At least now I understand whats going on.

-- GregGardinier - 09 Sep 2007

Workaround: Write %CALC{$INT($VALUE(08))}% to get 8

-- PeterThoeny - 09 Sep 2007

Change status to:
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-09-09 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.