Page 1 of 1
re : Pound Sign and Char 194
Posted: Wed Mar 29, 2023 10:24 am
by clp1000
Hello
I have this simple function below. It works perfectly in some of my PRGs, but not all of them.
I can copy this function as it is, and put it in another PRG, compile it and then when called/executed, it will add a character (194) before the pound sign in the final CSV file
Exactly the same function, in the same EXE, called in the same way.... but with differnet results
I cannot see any logical reason why ? Has anyone had anything simlar ? Any clues / ideas ?
I know I can swap the pound for chr(163) - but this won't solve the problem in future
Thanks
Chris
FUNCTION TestFunction()
qrepfile="c:\temp\test01.csv"
set alternate to (qrepfile)
set alternate on
set console off
?
? "£"
?
set alternate to
set alternate off
set console on
return .t.
Re: re : Pound Sign and Char 194
Posted: Wed Mar 29, 2023 11:41 am
by rdonnay
Have you tried SET CHARSET TO ANSI ?
Re: re : Pound Sign and Char 194
Posted: Wed Mar 29, 2023 12:30 pm
by clp1000
Yes, tried that, no difference, thanks
But anyway it wouldn't explain why it would work in 1 PRG file and not the other 1
Re: re : Pound Sign and Char 194
Posted: Wed Mar 29, 2023 9:05 pm
by Auge_Ohr
hi,
did we talk about Console or GUI ?
have you change AppSys() ?
which FONT do you use ?
---
have a look at SetLocale() in help File
it have a Sample for Euro Sign (check it) but you can enhance it for Pound Sign
Re: re : Pound Sign and Char 194
Posted: Thu Mar 30, 2023 12:06 am
by k-insis
One file is in ANSI and second source file in UTF encoding.
clp1000 wrote: ↑Wed Mar 29, 2023 10:24 am
Hello
I have this simple function below. It works perfectly in some of my PRGs, but not all of them.
I can copy this function as it is, and put it in another PRG, compile it and then when called/executed, it will add a character (194) before the pound sign in the final CSV file
Exactly the same function, in the same EXE, called in the same way.... but with differnet results
I cannot see any logical reason why ? Has anyone had anything simlar ? Any clues / ideas ?
I know I can swap the pound for chr(163) - but this won't solve the problem in future
Thanks
Chris
FUNCTION TestFunction()
qrepfile="c:\temp\test01.csv"
set alternate to (qrepfile)
set alternate on
set console off
?
? "£"
?
set alternate to
set alternate off
set console on
return .t.
Re: re : Pound Sign and Char 194
Posted: Thu Mar 30, 2023 1:36 am
by clp1000
k-insis wrote: ↑Thu Mar 30, 2023 12:06 am
One file is in ANSI and second source file in UTF encoding.
clp1000 wrote: ↑Wed Mar 29, 2023 10:24 am
Hello
I have this simple function below. It works perfectly in some of my PRGs, but not all of them.
I can copy this function as it is, and put it in another PRG, compile it and then when called/executed, it will add a character (194) before the pound sign in the final CSV file
Exactly the same function, in the same EXE, called in the same way.... but with differnet results
I cannot see any logical reason why ? Has anyone had anything simlar ? Any clues / ideas ?
I know I can swap the pound for chr(163) - but this won't solve the problem in future
Thanks
Chris
FUNCTION TestFunction()
qrepfile="c:\temp\test01.csv"
set alternate to (qrepfile)
set alternate on
set console off
?
? "£"
?
set alternate to
set alternate off
set console on
return .t.
You sir, are a genius - thanks a million
Thanks for all the replies from everyone