Hi,
i have a defined function, but when i run my program jumps the function without reading it. Here is how my code look like: - void processComboItem(); declaring the function
-
void TPosGetPaymentMethodForm::processComboItem()//details of the function
-
{
-
int key = PosMainForm->PosTrnObj->PayKey;
-
-
long double FITotal = PosMainForm->PosTrnObj->FinalInvoiceTotal;
-
long double FIDue = PosMainForm->PosTrnObj->FinalInvoiceDue ;
-
long double FIVat = PosMainForm->PosTrnObj->FinalInvoiceVat;
-
long double FIDiscount = PosMainForm->PosTrnObj->FinalInvoiceDiscount ;
-
double total = 0;
-
-
AnsiString StockCode = "";
-
AnsiString Slipnumber = PosMainForm->PosTrnObj->SlipNumber;
-
double value = 0;
-
PosDataForm->SelectQuery->Close();
-
PosDataForm->SelectQuery->CommandText = "SELECT StockCode,Value,Quantity FROM POS_Transactions WHERE Slip = '" + AnsiReplaceStr( Slipnumber, "'", "`" ) + "' and Type = '02'";
-
PosDataForm->SelectQuery->Open();
-
if (PosDataForm->SelectQuery->RecordCount > 0)
-
{
-
StockCode = AnsiString(PosDataForm->SelectQuery->FieldValues["StockCode"]);
-
value = double(PosDataForm->SelectQuery->FieldValues["Value"]);
-
PosDataForm->SelectQuery->Close();
-
PosDataForm->SelectQuery->CommandText = "SELECT IngredientID, Quantity FROM RECIPES WHERE KitchenItemID = '" + AnsiReplaceStr( StockCode.Trim(), "'", "`" ) + "'";
-
PosDataForm->SelectQuery->Open();
-
-
if (PosDataForm->SelectQuery->RecordCount > 0)
-
{
-
-
while(!PosDataForm->SelectQuery->Eof)
-
{
-
PosMainForm->PosTrnObj->Search(AnsiString(PosDataForm->SelectQuery->FieldValues["IngredientID"]),"POSTerminal" );
-
PosDataForm->SelectQueryCents->Close();
-
PosDataForm->SelectQueryCents->CommandText = "SELECT Value FROM POS_Transactions WHERE Slip = '" + AnsiReplaceStr( Slipnumber, "'", "`" ) + "' and StockCode = '"+AnsiString(PosDataForm->SelectQuery->FieldValues["IngredientID"])+"'";
-
PosDataForm->SelectQueryCents->Open();
-
-
if (PosDataForm->SelectQueryCents->RecordCount > 0)
-
{
-
total += double(PosDataForm->SelectQueryCents->FieldValues["Value"]);
-
}
-
-
PosDataForm->SelectQuery->Next();
-
}
-
}
-
-
total = value - total;
-
PosDataForm->UpdateCommand->CommandText = "UPDATE POS_Transactions SET Value = "+AnsiString(total)+", Total = "+AnsiString(total)+" WHERE Slip = '" + AnsiReplaceStr( Slipnumber, "'", "`" ) + "' and StockCode = '"+ StockCode +"'";
-
PosDataForm->UpdateCommand->Execute();
-
}
-
//restore values
-
PosMainForm->PosTrnObj->FinalInvoiceTotal = FITotal;
-
PosMainForm->PosTrnObj->FinalInvoiceDue = FIDue;
-
PosMainForm->PosTrnObj->FinalInvoiceVat=FIVat;
-
PosMainForm->PosTrnObj->FinalInvoiceDiscount=FIDiscount;
-
PosMainForm->PosTrnObj->PayKey = key;
-
-
}
-
-
//calling the function
-
void __fastcall TPosGetPaymentMethodForm::Button19Click(TObject *Sender)
-
{
-
processComboItem();
-
PosPaymentReceivedKeyPress(this, 'n');
-
}
when i run my application it doesn't go through the calling it skips that part.
can anyone help?
1 2366
Have you walked this code through your debugger?
Are you even calling this function: - void __fastcall TPosGetPaymentMethodForm::Button19Click(TObject *Sender)
-
{
-
?
BTW: TPosGetPaymentMethodForm::Button19Click does not use its argument.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: J.P. |
last post by:
Hi,
I found a function with the following header:
function checkLogin($username = '',$password = '',$groupid =
10,$goodRedirect = '',$badRedirect = '')
Now the writer of this function is...
|
by: Charles Larry |
last post by:
Is there a way to define functions after the main part of a Python
script?
Example:
#!/usr/local/bin/python
# this code yields a NameError
print_message("hello world")
|
by: bart_nessux |
last post by:
I need a script to call several functions at the same time. How does one
call more than one function simultaneously?
|
by: Ben |
last post by:
I am having trouble calling functions in another file.. Lets look at
the scenario below:
File xyz.cc: (I have both xyz.h and xyz.cc, for simplicity I've
avoided xyz.h)
------------
struct xyz...
|
by: Andrew Slade |
last post by:
Hello,
I am making calls from one compilation unit to functions in another by
pointers and I get the warnings below from gcc on 2.4.x Debian Linux. The
executable seems to work fine but the...
|
by: Dave |
last post by:
does calling a regular function cost any cpu time? In other words, is it
faster to write the code of two functions into main(), or is it the exact
same thing as calling two functions. I know its...
|
by: Kenneth Brody |
last post by:
The recent thread on "query about main()" got me thinking...
As I recall, calling a function with the wrong parameters causes
undefined behavior.
(These all assume that no prototype of foo()...
|
by: =?Utf-8?B?SnVsaWFu?= |
last post by:
My first problem is: I am having an issue when using a web service. The web
service is written by another department and say its running fine but when I
call it, I sometimes I get a...
|
by: bgold |
last post by:
Hey. I have a base class (SPRITE), and using this base class I have
derived a large number of derived classes (PERSON, BULLET, MISSILE,
etc.). Now, at a certain point in my program, I have a pair...
|
by: mreeves000 |
last post by:
Greetings,
Ok so, what I am trying to do is have one file that stores several functions so I can use them across the entire site.
So first I have the page, in every page I call header.php, and...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |