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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SET CURRENCY TO

Status
Not open for further replies.

Germancho

Programmer
Jul 9, 2003
36
0
0
Hi guys!

I want the user be able to change the currency simbol. I have a TextBox where the user introduce it and the LostFocus event has:

LOCAL lcCurrencyS

lcCurrencyS = ALLTRIM(THIS.Value)

But if I write:

SET CURRENCY TO lcCurrencyS

I get the error
** Command or phrase not recognized **
at developing time

SET CURRENCY TO '&lcCurrencyS'

I get the error
** Command or phrase not recognized **
at run time


How can I do that?
 
Try
Code:
set currency to (lcCurrencyS)

Regards

Griff
Keep [Smile]ing
 
Thanks Griff but

SET CURRENCY TO (lcCurrencyS)

doesn´t work neither.

Germán Restrepo
Bogotá, Colombia
 
Just for clarity:

Code:
lcCurrencyS = "£"
set currency to (lcCurrencyS)

works here - what have you got stored in lcCurrencyS?

Regards

Griff
Keep [Smile]ing
 
THISFORM.TxtCurrency.Value = "Bs" && Venezuelan currency

lcCurrencyS = ALLTRIM(THISFORM.TxtCurrency.Value)

SET CURRENCY TO (lcCurrencyS)

gime me the error
** Command or phrase not recognized **


Germán Restrepo
Bogotá, Colombia
 
Ahhh...

Try:
Code:
THISFORM.TxtCurrency.Value = '"Bs"'  && Venezuelan currency

lcCurrencyS = ALLTRIM(THISFORM.TxtCurrency.Value)

SET CURRENCY TO (lcCurrencyS)


Regards

Griff
Keep [Smile]ing
 
Sorry Griff, Bs is the value the user types on THISFORM.TxtCurrency TextBox.

In the LostFocus event I have:


LOCAL lcCurrencyS

lcCurrencyS = ALLTRIM(THIS.Value)

SET CURRENCY TO (lcCurrencyS)


I still get the error at run time.

Regards,



Germán Restrepo
Bogotá, Colombia
 
In many cases the value that 'set currency' is set too needs to be in quotes or double quotes...

So try:
Code:
LOCAL lcCurrencyS

lcCurrencyS = '"' + ALLTRIM(THIS.Value) + '"'

SET CURRENCY TO (lcCurrencyS)


Regards

Griff
Keep [Smile]ing
 
LOCAL lcCurrencyS

lcCurrencyS = '"' + ALLTRIM(THIS.Value) + '"'

SET CURRENCY TO (lcCurrencyS)


It doesn´t work. I get the same error at developing time.

Germán Restrepo
Bogotá, Colombia
 
Hang on - I'm working in the command window. let me try a form!

Regards

Griff
Keep [Smile]ing
 
Code:
LOCAL lcCurrencyS

lcCurrencyS = '"'+ALLTRIM(THIS.Value)+'"'

SET CURRENCY TO lccurrencys

works this end

Regards

Griff
Keep [Smile]ing
 
I think something is wrong with my VFP 8.0, I pasted your code and I still have an error. The SET CURRENCY TO lcCurrencyS is highlighted.

Thanks anyway Griff, you're very kind.

Germán Restrepo
Bogotá, Colombia
 
I am doing this in VFP-7
The following code works in LostFocus(), try it in the Valid() event. But remember to add a "RETURN .T." as the last line. I used a different variable name, lcNewCurrency, just in case of some conflict.

Code:
LOCAL lcNewCurrencyS
***MESSAGEBOX(ALLTRIM(THIS.Value))

lcNewCurrencyS = ""

lcNewCurrencyS = ALLTRIM(THIS.Value)
SET CURRENCY TO lcNewCurrencyS

RETURN .T.

 

There is something so wired with myh VFP 8.0. I get an error even if I type SET CURRENCY TO 'Bs' directly on both LostFocus and Valid event, or anywhere into the form; writting the same at the Command Window works fine!

Thank you.

Germán Restrepo
Bogotá, Colombia
 
No I can't. I write SET CURRENCY TO '$' and get the error too when I try to save. I don't understand what's happening.

Germán Restrepo
Bogotá, Colombia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top