You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

1

Sunday, September 12th 2010, 12:53pm

lowercase/uppercase issue (bug?)

I encountered something unexpected:

Source code

1
2
3
4
5
6
7
    <enum name="floors">
	<item name="Floor_1" data="mydata" />
	<item name="Floor_2" data="mydata" />
	<item name="Floor_3" data="mydata" />
    </enum>

trace("first floor: ", get(enum[floors].item[0].name));


Why does it say "floor_1" instead of "Floor_1"?

This is unexpected, because in all the rest of krpano's behavior, it does distinguish between upper and lowercase.
For example:

Source code

1
if("Floor_1" == "floor_1", trace("true"), trace"false") ) 

will return false...

So one would expect that krpano would also respect the case when returning names...
- Ronny D'Hoore

This post has been edited 1 times, last edit by "rdhoore108" (Sep 12th 2010, 1:12pm)


rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

2

Sunday, September 12th 2010, 1:11pm

get(enum[test].item["Floor_1"].name)

This returns null *smile*

I'm thinking that perhaps krpano does not allow capitals in names, but then again, I see capitals being used in the docs, for example in the code example in the explanation about textstyle.
- Ronny D'Hoore

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

3

Sunday, September 12th 2010, 1:25pm

Hi Ronny,

Try without "" ;-) :

Source code

1
get(enum[test].item[Floor_1].name)


SAlut.

rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

4

Monday, September 13th 2010, 7:19am

Yes, you are right, apparently it doesn't support quotes between [ ]. And also I should have written get(enum[floors].item["Floor_1"].name) if I wanted to remain consistent with my own example. *rolleyes*

Anyhow, it was simply to enhance my first point, which still remains valid. Why does krpano return a name in lowercase even though a capital was used its definition in the xml? *question* *confused*
- Ronny D'Hoore

rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

5

Monday, September 13th 2010, 2:35pm


Try without "" ;-) :


Here is yet another quote no-no:

Source code

1
if ("test" == "test", trace("true"), trace("false"));


Can you guess what it will return?

INFO: false
- Ronny D'Hoore

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

6

Monday, September 13th 2010, 3:24pm

Hi Ronny *smile* ,

Yes... Krpano is amazing *g* ...

Source code

1
2
3
4
5
6
	<action name="playing">
		showlog();
		if ("test" == "test", trace("true"," - ","test"," - ",get("test")), trace("false"," - ","test"," - ",get("test")));
		set("test",helo Ronny);
		if ("test" == "test", trace("true"," - ","test"," - ",get("test")), trace("false"," - ","test"," - ",get("test")));
	</action>


result:
INFO: false - test - null
INFO: false - helo Ronny - helo Ronny

SAlut...