Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Divide value
Message
From
11/07/2006 05:22:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/07/2006 01:24:38
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01134849
Message ID:
01135237
Views:
15
Mohammed,
You can do that like this:
-Create a new form
-Check the prg
For each "add object" add a control to your form. ie:
Add Object label1 As Label With ;
    Caption = "Principal", Left = 20, Width = 50, Top = 25
For this one add a Label (it says "as Lebel").
Name it label1 (it says "add object label1").
Set Caption,Left,Width,Top as "Principal",20,50,25 (it says "With ;
Caption = "Principal", Left = 20, Width = 50, Top = 25")

Other than adding objects there is only one piece of code:
Dblclick the commadnbutton you added and copy&paste the code between
Procedure cmdCalculate.Click
and
endproc
lines there.
That's all.
Cetin


>hi,
>thank you very much,
>just to know how? convert this code or any code to myform.scx and myform.sct.
>
>thanks.
>have a nice time
>m.qasem
>
>>Mohammed,
>>Code is there, you can copy/paste/modify yourself.
>>Cetin
>>
>>>hi,
>>>thank you very much,it works.
>>>
>>>another favor if you have time.
>>>
>>>how i can convert this code it to myform.scx and myform.sct becuse i need to another text at this form.
>>>
>>>and if i want to append all things form this form to mytable mean(data at grid and onther textbox.
>>>
>>>use my table
>>>append blank
>>>replace text1 with...
>>>replace text2 with...
>>>replace form mygrid...to my table
>>>
>>>thank you so much a gain.
>>>
>>>
>>>>>hi all,
>>>>>
>>>>>i need your help to distribution vlaue between 2 date as
>>>>>
>>>>>if my value =$100 and i want to distribution to 12 months start at 10/07/2006 to 10/07/2007 as
>>>>>from 10/07/2006 to 31/07/2006 value=5.833,
>>>>>from 01/08/2006 to 31/08/2006=8.333
>>>>>,month 9=8.333 to month6/2007=8.333,
>>>>>from 1/07/2007 to 10/07/2007 value=2.5000... this is for 1 year,
>>>>>
>>>>>but i need to do that between 2 date ex.. for 6 month , 8 ,10, 4 14,16 months or for 2 years? i need it to distribution as a bove...
>>>>>
>>>>>text1=month 7/2006,text2=5.833
>>>>>text3=month 8/2006,text4=8.333
>>>>>text5=month 9/2006,text6=8.833
>>>>>text7=month 10/2006,text8=8.833
>>>>>text9=month 11/2006,text10=8.833
>>>>>...
>>>>>.
>>>>>.
>>>>>.
>>>>>textn=month 7/2007=2.500
>>>>>
>>>>>thanks.
>>>>
>>>>You can use payment() function to calculate. ie:
>>>>
>>>>Public oForm
>>>>oForm = Createobject('myForm')
>>>>oForm.Show()
>>>>
>>>>Define Class myForm As Form
>>>>  DataSession = 2
>>>>  Height = 300
>>>>  Width = 480
>>>>
>>>>  Add Object label1 As Label With ;
>>>>    Caption = "Principal", Left = 20, Width = 50, Top = 25
>>>>  Add Object label2 As Label With ;
>>>>    Caption = "Interest", Left = 20, Width = 50, Top = 55
>>>>  Add Object label3 As Label With ;
>>>>    Caption = "Months", Left = 20, Width = 50, Top = 85
>>>>  Add Object label4 As Label With ;
>>>>    Caption = "Start", Left = 20, Width = 50, Top = 115
>>>>  Add Object txtprincipal As TextBox With ;
>>>>    Value = 100, Left = 80, Top = 25, Width = 100
>>>>  Add Object txtinterest As TextBox With ;
>>>>    Value = 0, Left = 80, Top = 55, Width = 100
>>>>  Add Object txtmonths As TextBox With ;
>>>>    Value = 12, Left = 80, Top = 85, Width = 100
>>>>  Add Object txtstart As TextBox With ;
>>>>    Value = (Date()), Left = 80, Top = 115, Width = 100
>>>>  Add Object cmdCalculate As CommandButton With ;
>>>>    Top = 145, Left = 80, Caption = "Go"
>>>>  Add Object grddistribution As Grid With ;
>>>>    Height = 280, Left = 190, Top = 5, Visible = .F., Width = 280
>>>>
>>>>  Procedure cmdCalculate.Click
>>>>    With Thisform
>>>>      lnPayment = Payment( .txtPrincipal.Value,;
>>>>        .txtInterest.Value,;
>>>>        .txtMonths.Value)
>>>>      Create Cursor crsDist (From d, To d, Amount Y)
>>>>      For ix=0 To .txtMonths.Value
>>>>        ldCurrent = Gomonth(.txtStart.Value,m.ix)
>>>>        ldFrom = Iif(m.ix = 0, m.ldCurrent, ;
>>>>          Date( Year(m.ldCurrent), Month(m.ldCurrent), 1))
>>>>        ldTo = Iif(m.ix = .txtMonths.Value, m.ldCurrent,;
>>>>          Gomonth(m.ldCurrent,1)-Day(Gomonth(m.ldCurrent,1)))
>>>>        Do Case
>>>>          Case m.ix = 0
>>>>            lnAmount = m.lnPayment * ((Day(m.ldTo)-Day(m.ldCurrent))/30)
>>>>          Case m.ix = .txtMonths.Value
>>>>            lnAmount = m.lnPayment * ((Day(m.ldCurrent)-1)/30)
>>>>          Otherwise
>>>>            lnAmount = m.lnPayment
>>>>        Endcase
>>>>        Insert Into crsDist (From,To,Amount) ;
>>>>          values ;
>>>>          ( m.ldFrom, m.ldTo,m.lnAmount)
>>>>      Endfor
>>>>      Locate
>>>>      .grdDistribution.RecordSource = 'crsDist'
>>>>      .grdDistribution.Visible = .T.
>>>>    Endwith
>>>>  Endproc
>>>>Enddefine
>>>>
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform