Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP7&9 Windows 7 Punctuation Anomoly 1

Status
Not open for further replies.

DSummZZZ

Programmer
Oct 24, 2000
4,250
US
I have a form with one pagefram which contains 10 pages.
One of the pages has a caption which reads "User Maint."
On my XP machine, the caption is fine in both the IDE and .EXE.
On my Windows 7 machine however, the caption reads ".User Maint" (Note the placement of the ".")
If I change the caption property on the properties sheet to read ".User Maint", the caption on the page reads "User Maint."!
I get the same behavior with characters that are not alpha nor numeric. In other words, !?<&%... all behave the same way, and only on a page caption. I don't get this behavior on a command button.
This is both within the IDE and a compiled .EXE on the Windows 7 box, for both VFP 7 and VFP 9.

Just wondering if anyone else had noticed this. I would hate to start writing code for dynamic captions depending on the OS.



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Interesting.

I don't get that with VFP9 on Vista.

B-)

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
To be fair, I just tried that with a button on a form, not a page frame...

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Ok

On a pageframe, even in design mode, it does exactly what you say in Vista!

(sorry for not properly reading your question!)

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Also I get the same result in VFP6 on Vista

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Dave,

I've heard of this problem before. Some time ago, there was a thread in this forum on the subject. I can't remember the details or whether there is a solution, but I definitely remember seeing it.

Sorry, that's not much help, but at least you know you're not alone.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike,

I remember that too, but also don't now what the reason was or if there was a solution other than putting the dot at first, if you want it last. Tried setting the caption programmatical and turned themes off, both doesn't work out.

Bye, Olaf.
 
Thanks all for the feedback. I don't recall seeing this in a thread before or I wouldn't have brought it up again. But oh well.

It's very curious why captions would behave this way for W7 and not for XP though. Like I said, I would hate to have to write OS specific code for something this silly.

I guess the best option is to avoid anything but alpha-numeric for page captions.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Hi Dave,

it may not have been a tek-tips thread. Could also have been somewhere else. It has to do with the OS, not with the foxpro version or SP. I wonder if there was a workaround. Using CHR(160) (nonbreakable space) as last char after a "." also doesn't help.

Bye, Olaf.

 
It is curious, any character outside the 0-9, a-z and A-Z ranges is reversed and tucked into/onto the wrong end!

You could write a function to sort it... but why does it do it?

Code:
FUNCTION PAGEFRAMECAPTIONFIXER
	PARAMETERS m.CAPSTRING
	PRIVATE m.CAPSTRING,m.PREFIX,I,X,m.STRING
	m.STRING = ""
	m.CAPSTRING = ALLTRIM(m.CAPSTRING)
	IF VAL(OS(3)) >= 6
		FOR I = LEN(m.CAPSTRING) TO 1 STEP -1
			IF ISTEXTORNUM(SUBSTR(m.CAPSTRING,I,1))
				** finished checking
				** pop it at the left
				m.CAPSTRING = LEFT(m.CAPSTRING,I)
				FOR X = 1 TO LEN(m.STRING)
					m.CAPSTRING = SUBSTR(m.STRING,X,1)+m.CAPSTRING
				NEXT
				I = 0
			ELSE
				m.STRING = SUBSTR(m.CAPSTRING,I,1)+m.STRING
			ENDIF
		NEXT
	ENDIF
	RETURN(m.CAPSTRING)

FUNCTION ISTEXTORNUM
	PARAMETERS m.MYCHAR
	PRIVATE m.MYCHAR,m.FLG
	m.FLG = .F.
	IF UPPER(m.MYCHAR) $ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
		m.FLG = .T.
	ENDIF
	RETURN(m.FLG)

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Found It!

There was an article on Foxite... it suggested setting the pageframe RightToLeft property to .f.

That sorts it

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Griff,

Glad you found something, I didn't pursue it any farther. I was just going to take my own suggestion and avoid punctuation.
Still somewhat odd that it does that with anything non alpha-numeric. I would think that as long as it was a printable character, it would behave as expected.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
It's an odd default. I *think* it is just set the wrong way, if you change the same property of a command button, you get the same result.

What is it for?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Righttoleft is for languages written right to left, arabic for example.

I wonder why this defaults to .T. now on Vista and Win7 or if it always defaults to .T.

I haven't installd any right-to-left language, and I assume you all too. So it's odd that this changed.

What I found is this report on Vista beta versions:
You may try, but this hotkey for changing left-to-right to right-to-left doesn't work for me, maybe it was only in the beta.

Still something of that bug remained, righttoleft should not be .t. for systems with only left-to-right languages installed. I bet this is not a foxpro bug, but an OS level bug, also because it just happens on Vista and Win7.

Bye, Olaf.
 
. I *think* it is just set the wrong way, if you change the same property of a command button, you get the same result.

That looks right. The default for pages seems to be .T. For all other controls, it's .F.

Very rum, especially as the Help says that RightToLeft is "disregarded unless you are running a Middle Eastern version of Microsoft Windows". I assume none of us is doing that.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Actually, it's starting to make some sense... not that the default is switched - I think that is just an error by the dev team... the behaviour.

If you are designing in a non-european language, you are probably talking about labels that contain (mostly) non ASCII alpha (0123456789ABCDEFGHIJKLMNOP...) characters, and the RightToLeft function would reverse all of them.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
I would think that if the RightToLeft property is set to .T. it would reverse the order of all the characters - or at least the words - rather than just the non alpha-numeric ones. So the behavior still don't make sense to me.

Oh well. At least it can be fixed without adding a bunch of code.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
In Arabic, for example - I think I've seen this in Dubai, the words read from right to left... but the numbers still work from left to right!

So if you had an expression like 'I want 300 widgets' it would convert to (roughly) 'stegdiw 300 tnaw I' [to get this to work in my head I had to think of the letters in the example as being the non-ASCII Arabic characters, like punctuation].

Perhaps this part of the behaviour is actually an OS bug-fix rather than a new bug!



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
In fact, taking it a bit further - I *think* that european words are written left to right in Arabic (when put there in context) like the numbers are.




Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top