definevar - Forum

Forum Navigation
You need to log in to create posts and topics.

definevar

Hello All,

I use the following command to specify the variable format

but the variable is not displayed in the format of the currency.

dbfSum "[pubdir]Data\mali.trq" "Daramad" "[Jdaramad]"
DefineVar "[Jdaramad]" "Currency" "" "Local" ""

can you help me?

@s7shanbe:

1) What is your expected (visual) text and what is it that you are seeing ?

2) what is the type/definition of the Daramad field in your database ?

3) Have you tried placing the DefineVar command BEFORE populating it with the dbfSum command ? ... according to the Help file ...

In order to delete a variable created with DefineVar, you must first re-declare the variable as “Undefined”, then clear it with SetVar

... so best to define such variables in your pub's StartUp section, and use the Global scope.

4) Finally, note that it says ...

Currency
The variable is limited to numbers and will be formatted as currency according to the regional settings in the Windows Control Panel.

... so make sure the regional setting on your computer is set as expected.

@gaev

1-The variable is undefined.
2- "Daramad" Field type is currency.
3. Yes, I did. Not true

@s7shanbe:

Your responses are a bit confusing.

1-The variable is undefined.

What variable are you talking about ?

2- "Daramad" Field type is currency.

I was not aware that dBaseIII/dBaseIV (the database behind the dbf plugin) had currency fields (i no longer have access to the Help file to confirm this) ... try using a plain decimal type field

3. Yes, I did. Not true

I am not sure what you "did" and what was "not true"

Please post the relevant commands ...

- that define the database
- in the Startup section
- around the dbfSum command

... and show us what is being displayed for the resulting variable

Separately, try this ...

DefineVar "[myCurrency]" "Currency" "" "Global" ""
SetVar "[myCurrency]" "45.67"

... and see if [myCurrency] is being displayed as expected.

Open chat
1
Do you need more info?
Hi, do you have any doubt?