Hi all,
I defined a function(?) ItemAmt in calculate.ch file. Include the file in the module I want to use the function. ie. #include "calculate.ch"
I can compile & generate an exe successfully. But when I open the form it gives me "Error BASE/1001 Undefined function: ITEMAMT".
What am I missing?
Thanks.
Using #define funtion
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Using #define funtion
Hi,
Can you show the exact definition part in .ch file?
Can you show the exact definition part in .ch file?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Using #define funtion
When you define something with #define you must remeber that all is case sensitive.
Am I wrong?
Am I wrong?
Re: Using #define funtion
Hi Rathinagiri,
This is in my calculate.ch file:
#define ItemAmt(weight, price, length, workmanshp, amount) Iif(amount = 0, Iif(weight != 0, weight * price, 0) + Iif(length = 0, workmanshp, workmanshp * length), amount)
I call it as an item in the COLUMNFIELDS of a grid.
'ItemAmt(Iif(StkItem->orig_qty=0, StkItem->weight, StkTrans->weight), GetPurcPrice(StkTrans->g_type, StkTrans->i_type, StkTrans->item), Iif(StkItem->orig_qty=0, StkItem->length, 0), Iif(StkItem->orig_qty=0, StkItem->workmanshp, StkTrans->workmanshp), Iif(StkItem->orig_qty=0, StkItem->amount, 0))'
Hi Mol,
I do matching the case when using.
Thanks.
This is in my calculate.ch file:
#define ItemAmt(weight, price, length, workmanshp, amount) Iif(amount = 0, Iif(weight != 0, weight * price, 0) + Iif(length = 0, workmanshp, workmanshp * length), amount)
I call it as an item in the COLUMNFIELDS of a grid.
'ItemAmt(Iif(StkItem->orig_qty=0, StkItem->weight, StkTrans->weight), GetPurcPrice(StkTrans->g_type, StkTrans->i_type, StkTrans->item), Iif(StkItem->orig_qty=0, StkItem->length, 0), Iif(StkItem->orig_qty=0, StkItem->workmanshp, StkTrans->workmanshp), Iif(StkItem->orig_qty=0, StkItem->amount, 0))'
Hi Mol,
I do matching the case when using.
Thanks.
Re: Using #define funtion
Why don't you simply declare this function without #define ???
I can't understand reasons of this declaration.
Marek
I can't understand reasons of this declaration.
Marek
Re: Using #define funtion
Hi Mol,
Yes. I came to that conclusion as well. This is a piece of old Clipper code. I would still be interested to see how it should be under Harbour. But I think I should post this in the Harbour forum/group rather than under HMG's.
Thanks.
Yes. I came to that conclusion as well. This is a piece of old Clipper code. I would still be interested to see how it should be under Harbour. But I think I should post this in the Harbour forum/group rather than under HMG's.
Thanks.