Page 1 of 1

Scan function

Posted: Thu Feb 27, 2014 8:03 pm
by Wim Gielis
Hi

Running TM1 10.2

The Scan function is having some problems, it seems.

Can someone run this TI code in a new process please?

Code: Select all

asciioutput('test.txt', numbertostring(Scan('A', 'AA')));
For me it gives "0", because............. ???

Wim

Re: Scan function

Posted: Thu Feb 27, 2014 8:06 pm
by jim wood
Once I run my 5th attempt at getting 10.2 installed I'll gladly run it for you. :)

Re: Scan function

Posted: Thu Feb 27, 2014 8:10 pm
by Wim Gielis
I *think* you will have finished with your problem earlier than I will with this problem, since every Scan test I do, fails! Very weird.

Re: Scan function

Posted: Thu Feb 27, 2014 8:11 pm
by jim wood
I don't know about that. With the lack of time I have at the moment for such things even IBM might beat to producing a fix. Come to think my 5th run might be 10.3, which will obviously cause me problems as well.

Re: Scan function

Posted: Thu Feb 27, 2014 8:17 pm
by Alan Kirk
Wim Gielis wrote:Hi

Running TM1 10.2

The Scan function is having some problems, it seems.

Can someone run this TI code in a new process please?

Code: Select all

asciioutput('test.txt', numbertostring(Scan('A', 'AA')));
For me it gives "0", because............. ???

Wim
Not a bug; you've got a rogue character in front of the A substring, specifically an ASCII 31 character. I noticed that there was a space between the quote and the A when the forum notification e-mail came in but I didn't see it in the post above; I assumed that you'd just edited it but that wasn't it.

When I copied your code and ran it I got a 0. So I typed the code in myself and got a 1. Then I took your code and stripped it down character by character and found that the substring that you're passing actually reads Ascii 39 (single quote), Ascii 31 (whatever that is, can't recall. Edit: It's a Unit separator control code, which is why it isn't visible), Ascii 65 (capital A), Ascii 39 (single quote).

Re: Scan function

Posted: Thu Feb 27, 2014 8:23 pm
by Wim Gielis
Great thanks Alan, I did not think about a character in front of the A! Okay, I can now continue :-)

Re: Scan function

Posted: Thu Feb 27, 2014 8:23 pm
by declanr
I ran the test and can confirm the same thing Alan has found, confused me for a while though.

Using CX10.2

I have found an even weirder issue though; to be fair I am using Excel 2013 (which isn't supported with CX10.2)

I have an excel sheet that starts with a subnm ( 'period', 'current', 1 ); the result is "Jan"... this is correct, the subset contains only 1 element.

In the sheet I have an action button that rolls forward the period, changes a load of rules, loads data etc but also changes that subset... seeing the result in server explorer I can confirm that the subset IS updated correctly ("Feb" being the only element in it). In excel however, after F9, shift F9, CTRL ALT SHIFT F9, Banging head on desk, tears... the sheet still says "Jan"...

I can put a new SUBNM formula in a different cell in the sheet, it still says "Jan".
I can close the sheet, with excel still open, re-open the sheet... still says "Jan".

If I close the whole of excel, open excel, open the sheet (connect to tm1 again somewhere in there)... it finally says "Feb".

Now that is some mega caching weirdness right there.

Re: Scan function

Posted: Mon Mar 03, 2014 9:09 am
by rmackenzie
declanr wrote:I have found an even weirder issue though; to be fair I am using Excel 2013 (which isn't supported with CX10.2)
Declan, Excel 2013 has a fundamental change from a MDI to SDI application that might have some significant issues for TM1/ Excel. The Perspectives add-in probably has a lot of (old-ish) code that didn't consider this sort of shift in functionality.
declanr wrote:If I close the whole of excel, open excel, open the sheet (connect to tm1 again somewhere in there)... it finally says "Feb".
Sounds like you've got a bit of VBA doing an N_CONNECT or similar in there? The Excel 2013 event model has probably had a change meaning that some TM1 VBA code might not have the same result in Excel 2013 as it did in earlier versions. Note the comments like:
microsoft wrote:Custom ribbon tabs and controls that assumed a single ribbon UI per application instance in previous versions of Excel will now be propagated onto each workbook ribbon in Excel 2013. Whereas in MDI the custom ribbon developer didn’t need to consider multiple instances of their controls on different instances of Excel’s ribbon UI, with SDI they will need to account for this situation.
If you want to keep all the ribbon UI controls in the same state across open workbooks, you will need to:
Ensure that the code is able to cycle through the workbook windows and update the state of the controls.
...
and
microsoft wrote:With the shift to SDI, all of the Excel application-level window methods, events, and properties remain unaffected and work the way they have in previous versions of Excel (for example, Application.ActiveWindow, Application.Windows, and so on).
In Excel 2013, all of the workbook-level window methods, events, and properties now operate on the top level window...
etc.

:roll: