676

(37 replies, posted in General)

I used MVD v2.7 and 3.3 to compile. In both, I get the following error:
https://s13.postimg.org/4rb80q17b/zzzzz_Temp10.png

677

(1 replies, posted in General)

Is it possible to hide a folder within MVD compiled app? If so how please?

I have tow image folders within app root folder. I like to hide Application Images folder to avoid user mixing up with their image folder (linked image save) and deleting wrong images.

678

(3 replies, posted in General)

Thanks a lot Dmitry....

Looks like you missed Apostrophe. The following worked for me:

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
    OpenFile('Application.ExeName');
    Form1.Close;
end;

679

(37 replies, posted in General)

Hi EHW,


Thank you very much for your kind help...................


I get script error message: near "," : syntax error, which I couldn't spot and correct.
when choosing day from recurring every... combo without checking date and time fields
when choosing week, fortnight, month, quarter and annually from recurring every... combo with or without checking date and time fields.


That might work for the first time of the expense, but it still does not answer when to create the next expense.

My thinking was that date and time below recurring every... combobox would be the answer.


Currently, it saves and displays two expense record, one for actual current expense and one for recurring expense on creation of an expense record. Tha's fine but could we have recurring one displayed on specified date and time below recurring every... combobox on tGrid?

680

(3 replies, posted in General)

Is it possible to restart an app on click of a button within app? If so, how?


Running an app build with MVD. Within the app I click on a button (i.e. restart button) and application closes and restarts itself.

681

(37 replies, posted in General)

After thinking a bit, initial trigger is recurring checkbox is checked then save button trigger when first expense saved with recurring checkbox is checked?

682

(10 replies, posted in General)

Hi Derek,


GREAT Stuff..................
Thank you very much................................

683

(10 replies, posted in General)

Great examples Derek... Thank you very much...


tGrid2 (with filter) what I was trying to do.
Main reason for the filter was applying footer count. My assumption was it'd count only cells with values displayed but it counts all cells therefore producing wrong count. Is it possible to count cells with values displayed only?
Sorry for the shortcoming on my side for failing to make all clear.

https://s27.postimg.org/64s0kze8z/zzzzz_Temp9.png

684

(10 replies, posted in General)

Hi Derek,


Thanks a lot....


sale = 1 and replacement is 1
(sale = 1) and (replacement is 1)
The above ones didn't work. I get blank tGrid


However, when use only one as below works
sale= 1
or
sale is 1
replacement= 1
or
replacement is 1


In this case I need to use both - checked values only on same tGrid.
https://s16.postimg.org/rk562d9lh/zzzzz_Temp8.png


ps/. I downloaded ok after few minutes.

685

(10 replies, posted in General)

I have two boolean field to display on tGrid.
I like to display only checked values.
Tried the following filter on tGrid settings/filter but didn't work:
(sale is 1) AND (replacement is 1)

686

(37 replies, posted in General)

Hi EHW,

Thanks for the info....
The problem is I know what I want to do but don't know how to do it.
All I can think of that initial trigger is recurring expense checkbox is checked or not. I made the following flowchart in an attempt to clarify bit further. I'm open to suggestions, perhaps there is simpler way to do it?
https://s29.postimg.org/wbtm6gtyv/recurring_01.png

687

(37 replies, posted in General)

AD1408 wrote:

I
If an expense entered with "This is a recurring expense" checkbox checked, Recurring every... specified on combobox, Recurrence date and time specified and saved then application saves a new expense with same values at specified period, date and time automatically until "This is a recurring expense" checkbox unchecked.

In line of the description above, how can I create a recurring event script, in this case recurring expense?
(With reference to attached sample project on post #1)

688

(37 replies, posted in General)

I still couldn't do a working script for recurrence..


What I like to do is:
If an expense entered with "This is a recurring expense" checkbox checked, Recurring every... specified on combobox, Recurrence date and time specified and saved then application saves a new expense with same values at specified period, date and time automatically until "This is a recurring expense" checkbox unchecked.


Please see the sample project attached:

689

(6 replies, posted in General)

Thanks Dmitry...


Do you have any plans to support calling functions from external dll files any time soon?

690

(6 replies, posted in General)

Thanks JB.....


I have edited my post to include MVD so it's still an open question for the needed info.

Could you please provide info about how to call functions from external dll files in MVD?

691

(6 replies, posted in General)

Hi Dmitry,


Could you please provide info about how to call functions from external dll files in MVD?

692

(9 replies, posted in General)

After checking samples in SQLite studio I noticed that Derek and Mathias populated items in question manually. If I'm wrong please correct me.


Mathias, if and when you have a time if you could add following futures to your calendar sample app, it would be great.

1. Ability to click on a cell (single and double-click) to select a day to add events to it.
2. Enabling user to add a small image (with max constrains of i.e. 32x32 px) in day cell to highlight there is a some kind of entry for the day.
3. For weekends and holidays we could use font coloring rather than cell coloring.

693

(17 replies, posted in Script)

Hi Dmitry,


Thank you very much.............................
Great stuff as usual...... Appreciated very much........

694

(9 replies, posted in General)

Hi Guys,


Derek,
Thanks for sharing... Nice little application.
1. I guess it's not possible to customize calender as shown on your screen cap. in MVD?
2. How did you populate drop-down combo boxes? There is no form to add items for them, no calc. fields and I couldn't see hard coded items.


Mathias,
Thank you for sharing sample year calender..... Interesting approach using tGrid. It could be a manual workaround for calender as MVD calender component is very basic and doesn't support few things needed when one wants to use in a reminders etc. app.

What we need are:
1. Ability to click on a cell (single and double-click) to select a day to add events to it.
2. Enabling user to add a small image (with max constrains of 32x32 px) in day cell to highlight there is a some kind of entry for the day.
3. For weekends and holidays we could use font coloring rather than cell coloring.


Question:
How did you fill months and days on your tGrid?

695

(17 replies, posted in Script)

I put 1 analog clock for local but couldn't add another one that works in this case for Honolulu..


https://s15.postimg.org/lqsl8zh1n/zzzzz_Temp7.png


When adding second analog clock, I couldn't prevent handles repainting.


Please see the attached sample project:

696

(17 replies, posted in Script)

Hi Derek,


Thanks a lot for the sample project............................


It's fine using PC clock as a base. It'd be much more easier for a user if getting time is automated. That's why I was hoping to get time from the web. By the way I couldn't find how you displayed labels from 2 to 24 so that I can customize and add more clocks?
EDIT: I have found labels, you have used a blank characters for each label except label 1. Therefore customizing and adding more clocks resolved.


The following makes all clocks live which I wanted:

var
   Timer: TTimer;

procedure formwtz_OnShow (Sender: string; Action: string);
begin
     Timer := TTimer.Create (nil);
     Timer.OnTimer := @OnTimer;
     Timer.Interval := 1000;
     Timer.Enabled := True;
end;

procedure OnTimer;
begin
  //Form1.Label1.Caption := FormatDateTime('c', Now);  //Shows date and time together
  formwtz.label25.Caption := FormatDateTime('ddd dd mmm yyyy', Now); // Shows date: Wed 01 Mar 2017 depending on comp date display settings
  //Form1.Label2.Caption := FormatDateTime('t:s', Now); //Shows clock only with hour minutes and seconds
  //formwtz.Label26.Caption := FormatDateTime('hh : mm : ss', Now); //Shows clock only with hour minutes and seconds
  formwtz.label26.caption := 'Local Time is:  ' +FormatDateTime('hh : mm : ss', Now);

  formwtz.label1.Caption  := sqlexecute('select city from ctz where labelno = "01"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "01"')/24));
  formwtz.label2.Caption  := sqlexecute('select city from ctz where labelno = "02"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "02"')/24));
  formwtz.label3.Caption  := sqlexecute('select city from ctz where labelno = "03"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "03"')/24));
  formwtz.label4.Caption  := sqlexecute('select city from ctz where labelno = "04"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "04"')/24));
  formwtz.label5.Caption  := sqlexecute('select city from ctz where labelno = "05"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "05"')/24));
  formwtz.label6.Caption  := sqlexecute('select city from ctz where labelno = "06"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "06"')/24));
  formwtz.label7.Caption  := sqlexecute('select city from ctz where labelno = "07"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "07"')/24));
  formwtz.label8.Caption  := sqlexecute('select city from ctz where labelno = "08"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "08"')/24));
  formwtz.label9.Caption  := sqlexecute('select city from ctz where labelno = "09"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "09"')/24));
  formwtz.label10.Caption := sqlexecute('select city from ctz where labelno = "10"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "10"')/24));
  formwtz.label11.Caption := sqlexecute('select city from ctz where labelno = "11"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "11"')/24));
  formwtz.label12.Caption := sqlexecute('select city from ctz where labelno = "12"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "12"')/24));
  formwtz.label13.Caption := sqlexecute('select city from ctz where labelno = "13"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "13"')/24));
  formwtz.label14.Caption := sqlexecute('select city from ctz where labelno = "14"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "14"')/24));
  formwtz.label15.Caption := sqlexecute('select city from ctz where labelno = "15"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "15"')/24));
  formwtz.label16.Caption := sqlexecute('select city from ctz where labelno = "16"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "16"')/24));
  formwtz.label17.Caption := sqlexecute('select city from ctz where labelno = "17"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "17"')/24));
  formwtz.label18.Caption := sqlexecute('select city from ctz where labelno = "18"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "18"')/24));
  formwtz.label19.Caption := sqlexecute('select city from ctz where labelno = "19"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "19"')/24));
  formwtz.label20.Caption := sqlexecute('select city from ctz where labelno = "20"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "20"')/24));
  formwtz.label21.Caption := sqlexecute('select city from ctz where labelno = "21"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "21"')/24));
  formwtz.label22.Caption := sqlexecute('select city from ctz where labelno = "22"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "22"')/24));
  formwtz.label23.Caption := sqlexecute('select city from ctz where labelno = "23"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "23"')/24));
  formwtz.label24.Caption := sqlexecute('select city from ctz where labelno = "24"')+':  '+timetostr(time+(sqlexecute('select pm from ctz where labelno = "24"')/24));
end;

procedure formwtz_OnClose (Sender: string; Action: string);
begin
     Timer.Free;
end;

I have tried analog clocks version but couldn't........
Could you possible change 2 of the 24 clocks to analog clocks so that we can have combination of digital and analog clocks on same form please - Live version as in the code above?

697

(6 replies, posted in General)

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


Great stuff... Appreciated......

698

(6 replies, posted in General)

Thank you very much EHW.......................


That's what I wanted do.


I wanted to add your warning after cancel code to it. In this situation giving user another chance before canceling (deleting) the record.
I tried as follows but couldn't make it work... Perhaps they don't fit together?

var
Start_Data, End_Data: String;

procedure frmStudent_Cancel_Button_OnClick (Sender: string; var Cancel: boolean);
begin
    End_Data := Load_Record_String(frmStudent);
    If Start_Data <> End_Data then
      Begin
        If MessageBox('Changes were made to the data on this form.'+#13#10#13#10+ 'Are you sure you want to cancel changes?','Confirm',MB_YESNO+MB_ICONQUESTION) = IDYES then
          frmStudent.Close else
          Begin
          frmStudent.btnSave.SetFocus;
          Cancel := True;
          Exit;
          End;
      End;

    if (frmStudent.dbAction = 'NewRecord') then
      begin
      SQLExecute('DELETE FROM checks WHERE id_Student='+IntToStr(frmStudent.btnSave.dbGeneralTableId));
      SQLExecute('DELETE FROM student WHERE id='+IntToStr(frmStudent.btnSave.dbGeneralTableId));
      end;
end;

procedure frmStudent_OnShow (Sender: string; Action: string);
begin
    Start_Data := Load_Record_String(frmStudent);
end;

function Load_Record_String(Form: TAForm): String;
var
    i,c : Integer;
    Record_String: String;
begin
    c := Form.ComponentCount - 1;
    Record_String := '';
    For i := 0 to c do
    begin
       IF Form.Components[i] is TdbEdit Then Record_String := Record_String + TdbEdit(Form.Components[i]).text;
       IF Form.Components[i] is TdbEditCount Then Record_String := Record_String + TdbEditCount(Form.Components[i]).text;
       IF Form.Components[i] is TdbMemo Then Record_String := Record_String + TdbMemo(Form.Components[i]).text;
       IF Form.Components[i] is TdbComboBox Then Record_String := Record_String + IntToStr(TdbComboBox(Form.Components[i]).dbItemID);
       IF Form.Components[i] is TdbCheckBox Then
         Begin
           If TdbCheckBox(Form.Components[i]).checked = True then Record_String := Record_String + '1'
             else Record_String := Record_String + '0';
         End;
       IF Form.Components[i] is TdbDateTimePicker Then
         Begin
          if TdbDateTimePicker(Form.Components[i]).Checked = False then Record_String := Record_String + ''
           else Record_String := Record_String + DateToStr(TdbDateTimePicker(Form.Components[i]).datetime);
         End;
    end;
    Result := Record_String;
end;

699

(17 replies, posted in Script)

Hi Dmitry,


Thank you very much...................
Great stuff...... Appreciated.


Next step would would be to have multiple clocks for different locations around the world beside the local time. For this I guess app needs to connect to Internet to get specific location time.


I hope I'm not asking too much. You have been very kind and providing GREAT help and support.

700

(6 replies, posted in General)

Thank you very much Dmitry...................


It works fine. It's almost there as to what I was looking for.
On new record clicking on Cancel button on student form deletes the record in all circumstances.
Currently it deletes new record, if I initiate second level add (i.e. clicking on add button on student form to add a Test then canceling without save). However, If I save something  on second level, naturally it shows on student form tGrid. What I like to do is clicking on cancel button on students form deletes the record regardless student form tGrid has saved record/s or not - Only on newrecord situation.