Something I have never been able to get my head around ever since Delphi 1 was released (I am now using Delphi 6 Enterprise) is how to use a "Watch".
Sometimes I need to know
When (say) MyTableMyField.value = (say) 100.
When (say) MyTableMyField.value changes bearing in mind that to use the...
gcaramia
>What's your DB?
Parodox table "tblMStock".
Field "Item" is the required monetary value of the square area.
Field "SqMtrs" is obvious and a numric value
Field "CostPMetre" is obvious and a monetary value.
...from "downunder" Mate! For studying my problem PROPERLY!
THIS works. A star for you. :-)
tblMStocksqMtrs.Value := RoundTo(tblMStockHght.Value * tblMStockWdth.Value, -2);
KempCGDR
>And note that posting something that is essentially the same problem in a new thread is frowned upon at...
towerbase
Thanks Andrew! As usual you are a credit to this great website.
KempCGDR
>If you can't get your head around passing a variable into >a function then I really would advise you to do some >simpler stuff until you get used to programming.
I apologize for not having been involved in...
gcaramia
If you look carefully you will see that "RoundTo(1.234, -2) will be 1.23" as referred to be whosrdaddy is quite meaningless in my code Since I don't HAVE a 1.234 to "RoundTo". I have a FIELD VALUE tblThingTotSqMtrs.Value ... which could be ANYTHING. Including 1.234.
Having added...
I have Math in the Uses clause but the following nevertheless won't work. Can someone please tell me why?
tblMStockItem.Value := FloatToCurr(tblMStockSqMtrs.Value * tblMStockCostPMetre.Value);
...clause but neither of the following will work for me. I need
dm.tblMStockInitSqMtrs.Value to be limited to TWO decimal points.
tblMStocksqMtrs.Value := RoundTo(tblMStockHght.Value * tblMStockWdth.Value);
OR
RoundTo(tblMStocksqMtrs.Value) := (tblMStockHght.Value * tblMStockWdth.Value);
>function RoundTo is in unit Math (D6 or later)
>function FloatToCurr is in unit SysUtils
So ...?
How does that help me? How do I apply that in my code above?
Thanks. :-) But you don't show how one APPLIES that information - using the above code?
Are you saying I should declara a function RoundTo?
If so what is it supposed to look like? The following isn't going to work because "1.234" is meaningless.
function RoundTo(1.234, -2);
Similarly...
Try this ...
FIRSTLY
Create MyTable.db with DelphiDesktop whereby you have
HisNo N *
HisName A 20
Drop a TQuery (name it qryMyTable), TUpdate (name it updMyTable)and a TDataSource (name it dtsMyTable)on your form. Note that qryMyTableUpDatePropery must be updMyTable.
SECONDLY
In the SQL...
Problem A
tblThingTotSqMtrs.Value := (tblThingHight.Value * tblThingWidth.Value);
This results in a number such as 43.6743 whilst I need it to be 43.67
Problem B
tblThingCost.Value := (tblThingTotSqMtrs.Value * tblThingCostPerSqMtr.Value);
This won't even compile and results in exception...
Nice hearing from you again Steven!
I am not using Interbase as the application is designed to be used on a stand-alone (Paradox) basis by single users. Where (if necessary) a LAN would easily suffice for expansion to other (local) systems.
This is essentially because (as you will know)...
Thanks to my son (in Cape Town: South Africa who was programming in machine code at the age of 12 on my Sharp 3201) I (now in Melbourne Australia) now have the total solution to this problem. Which I think is worth adding here and is as as I got it from him :-)
The first thing to do is backup...
ChrisGSchultz (IS/IT--Manageme) 9 Mar 05 22:24
It looks like your performing an SQL query
Yup! Several ... but these have not caused complications in the past.It seems the problem is being created by the recent additional forms which I have included.
I suspect I shall have to seriously...
I should have added the exact exception which I get which is as follows ...
Project MyProg.exe raised exception class EDBEngineError with message 'Capability not
supported. Insufficient memory for this operation.
Table: C:\Program Files\LAB\MyProg\_QSQ131.DB."
These files are being created in the folder where my source files are.
Upon running my project (from within the environment and
whilst it is still loading the files) it has suddenly taken to giving me an exception which refers to _QSQ99.DB or (some similar file) to the effect that I have "not...
Sorry guys! You have both got it wrong!
The message is making a STATEMENT. It is not asking a question.
My problem is that the following bit doesn't work :-)
+ dmStdAcc.qryGLGLNo.value +
Any more suggestions?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.