951

(3 replies, posted in General)

Is it possible to use table grid as edit fields? In other words can I use table grid for adding/editing records instead of using edit textbox component?

952

(11 replies, posted in General)

Makes perfect sense... Unfortunately, I failed to see it...


Thanks a lot Derek.....

953

(0 replies, posted in General)

I found a spreadsheet on the net and wanted to turn it into application. Spreadsheet is included in project folder.


Some may say, why don't you just use spreadsheet. I think app version could be used as a part, when developing other applications. Beside application has certain advantages over spreadsheet depending on the usage.


As far as I could understand it requires applying formulas in script rather than just calculated fields settings, as multiple calculated fields needs to be used by other calculated fields. All needed formulas are on the included spreadsheet.


If some of you guys can take on this challenge, it'd be great learning experience for me and perhaps some other MVD users.

954

(32 replies, posted in General)

Thanks Lee.....


but formula

futurval := Power((futurval DIV initialval),(1 DIV period)) -1; 

returns 0

955

(11 replies, posted in General)

Hi Derek,


Thanks a lot... Extra thanks for table grid display info...


I have added more buttons just for exercise.. One issue tho, on run highlight image gets displayed at first, until after moving mouse over image buttons?

956

(32 replies, posted in General)

Hi Mathias,


Great stuff as usual...


Thanks a lot for the sample project and excellent commenting on code.



-----------------------------------------


I have checked the sample calc, but I think it returns incorrect results.


You can test calc results here.

http://www.investopedia.com/calculator/cagr.aspx

957

(11 replies, posted in General)

Hi Derek and JB,


What I'm trying to do is using images as buttons with image highlight on mouse over. You both guys did the image highlight fine. Thanks again.


I'm stuck on associating image button to actual button action. For instance, when I like to use an image as a button for adding new record, searching, deleting etc. moving mouse over image button creates image highlight and performs the intended action on click. i.e. If I clicked on delete image button, on click it should delete the selected record.


Please see attached Image Button2 sample project.

958

(11 replies, posted in General)

Hi Guys,


Thanks a lot...........
Special thanks to Derek for showing additional methods...


We have show form action.. I added close action to another button, it seems to work, However, with others not so lucky


procedure Form1_Image1_OnClick (Sender: string);
begin
    Form1.New;  //Add new record image on the form1
end;


I tried;
Form1.NewRecord;  and Form1.New;
I get error on compile for both instances. How do we associate image to other button actions such as new record, save, delete, search and so on?

959

(32 replies, posted in General)

Here is the math formula I was trying to apply to MVD script code but couldn't get it working:


OutputGrowthRate = (FutureValue / InitialValue1)^(1/ Periods1)-1

960

(11 replies, posted in General)

Hi JB,


Thanks a lot....


I couldn't do it, please see attached sample project.
LoadImage link should be relative, not specific to a location. User may have the application on D, E, etc drive.
Keep in mind JB, you are talking to beginner with one brain cell.

961

(11 replies, posted in General)

I have tried to add a highlight effect on image button (when mouse move on the image button) but couldn't.


Is it possible? If so how?

962

(32 replies, posted in General)

Hi Lee,


Converting % value was easy,


However, I couldn't create a formula to calculate "Compound Growth Rate" correctly.


InitalValue1 1000
OutputFuturevalue 2593
Periods1 10


Calc. should return
Compound Growth Rate: 10

963

(32 replies, posted in General)

Hi Lee,


Thanks a lot...........


That works.


Now I need to adjust the formula so that when user enters "Compound Growth Rate" as 10 (%)  it'd convert to 0.1 and use it in calc. converted value.


I also need to the formula for calculating "Compound Growth Rate" (second part of CAGR calculator)..  I'll have a go at it.

964

(5 replies, posted in General)

Thanks a lot for your patience Derek... I was missing search button name... All clear now.

965

(5 replies, posted in General)

Hi Guys,


Thanks a lot for the info....

As usual nice info Derek.  How do you define "bSearch" or "bSQL" atributes in  'incremental search' object properties?

966

(32 replies, posted in General)

Hi Mathias,


Thanks a lot for the formula...


However, calculation result is wrong. I used on calc:
Initial value 1000
Number of Periods 10
Compound Growth Rate 10
Calculated result for Future Compounded Value: 3


Calculated result should have been: 2593.7424601


I have used your formula as below:

OutputFutureValue := Power(InitialValue * (1 + GrowthRate), Periods);

967

(5 replies, posted in General)

Is search for only exact matches or I'm missing things?


For instance on example Phone Book app there are 3 sample records.
Richard Little
Leon Akers
Tricia Thibault


I search for leo or Leo in first name field only, search doesn't produce any result. If I search for Leon then it finds the record.

968

(32 replies, posted in General)

Hi Lee,


I couldn't get your formula to compile. However, thank you very much for the effort.


Perhaps somebody here can offer the solution....................................

969

(32 replies, posted in General)

Thanks  for the info Lee.....


I'm not clear about variables and formula in your explanation. Actual formula needs to be used in this project code is:



OutputFutureValue := InitialValue * (1 + GrowthRate) ^ Periods; 

Problem is I couldn't work out power (^) part in script.


Could you not put in project code which starts at line 200 or into code below?


//CALCULATIONS
procedure Form1_Button3_OnClick (Sender: string; var Cancel: boolean);
var    //---> First declare your variables (pay attention to the type, integers take no decimals, real can have decimals and so on ...)

    //INPUT VARIABLES
    InitialValue : Currency;
    Periods, GrowthRate : Real;

    //OUTPUT VARIABLES
    OutputFutureValue : Currency;


begin
    //---> Second, assign the variables you have declared to your edit fields
    //Input Variables
    InitialValue := Form1.EdInitialValue.Value;
    Periods := Form1.EdPeriods.Value;
    GrowthRate := Form1.EdGrowthRate.Value;


    if (Trim(Form1.EdInitialValue.Text) = '') OR  (Trim(Form1.EdPeriods.Text) = '') OR  (Trim(Form1.EdGrowthRate.Text) = '') then //if any of the field is empty
        begin
            Cancel := True; //Stop the operation
            ShowMessage('All fields marked with an asterisk (*) are required. Calculation can only be performed when all required fields are filled.'); //display the warning
        end

    else //None of the fields are empty, let's continue
        begin

            //---> Third, perform your calculations

                        OutputFutureValue := InitialValue * (1 + GrowthRate) ^ Periods;
                        Form1.EdOutputFutureValue.Value := OutputFutureValue;

970

(10 replies, posted in General)

Hi Derek,


Many thanks for another great lesson. This one went in my Rough Guide to MVD help file too, of course credited to you.


Your previous help on displaying text file in a memo was great. I'm using it for displaying license text  on about window.


For modeless window context help was just an simple example. I have different uses in mind, such as adding / editing a record on modeless window and viewing saved records on another window while both are accessible (one at a time). This may create further complications in respect of refreshing windows but it may also be overcome with you guys help.

971

(32 replies, posted in General)

I think I got the Divisior bit working, not 100% sure tho.


However, on formula front no success. Math formula I'm trying implement is:


y = a(1 + r)^x


where:
y = future compounded value
a = initial value
r = growth rate
x = number of periods


I got the following object pascal implementation from another forum:


uses
  Math;
 
function CAGR(initial_value, grouth_rate, number_of_periods: double): double;
begin
  result := initial_value * Power(( 1 + grouth_rate), number_of_periods);
end;
 
begin
  writeln(CAGR(5.1, 10.4, 2.2):0:2);
  readln();
end.

Unfortunately, I couldn't implement it in MVD.

972

(10 replies, posted in General)

Hi Derek,


Thanks a lot for your suggestion.


I have some uses for Modeless windows. Dmitry was kind enough to supply a script for it but it didn't work for me, or more likely I couldn't implement it correctly.


However, your suggestion is valuable to me. It'll go in my Rough Guide to MVD help file.


I have updated modeles window project with an example usage info on forms.

973

(10 replies, posted in General)

AD1408 wrote:

Hi Dmitry,


I Could't get it work


https://s21.postimg.org/q13z107bb/modeless_win.png

974

(10 replies, posted in General)

Hi Derek,

I wanted to have  modeless window/s but implementation of Dmitry's script by me obviously incorrect.

975

(10 replies, posted in General)

Hi Dmitry,


I Could't get it work