Scan function

Post Reply
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Scan function

Post 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
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Scan function

Post by jim wood »

Once I run my 5th attempt at getting 10.2 installed I'll gladly run it for you. :)
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Scan function

Post 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.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Scan function

Post 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.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Scan function

Post 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).
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Scan function

Post by Wim Gielis »

Great thanks Alan, I did not think about a character in front of the A! Okay, I can now continue :-)
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Scan function

Post 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.
Declan Rodger
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: Scan function

Post 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:
Robin Mackenzie
Post Reply