1

(5 replies, posted in Russian)

procedure Form1_Edit1_OnChange (Sender: TObject);
var  vrowcount: integer;
begin
  for vrowcount := 0 to form1.tablegrid1.RowCount - 1 do
    begin
      form1.tablegrid1.cell[1,vrowcount].color := clwhite;
      if strtodate(form1.tablegrid1.cells[1,vrowcount]) >= now + form1.edit1.value then form1.tablegrid1.cell[1,vrowcount].color := clGreen;
      if strtodate(form1.tablegrid1.cells[1,vrowcount]) <= now + form1.edit1.value then form1.tablegrid1.cell[1,vrowcount].color := clRed;
      if form1.edit1.Text = '' then form1.tablegrid1.cell[1,vrowcount].color := clwhite ;

     form1.tablegrid1.cell[3,vrowcount].Text:= (DaysBetween(Now, strtodate(form1.tablegrid1.cells[1,vrowcount]))); _ need help please
    end;
end;

I have a compiled project with the older version 1.52Beta and when I try to compile it with the new version 5.4Beta I get the following message and the scripts do not work. (I have tried version 3.11 and do not give this error, after version 3.11 it fails if the project is compiled.)
  List index out of bounds (1)

3

(5 replies, posted in Script)

You can insert typed "enter" into the textRTF field, and a BOLD text like ...

Diagnostic.RichEdit1.TextRTF: = 'Error Code - \ r \ n' + # 13 + Diagnostic.EditDiagnostic.text + # 13 + 'Defect -' + # 13 # 10 + diagnostic.Memo1Diagnostic.text + 'Remedy / + diagnostic.Memo2Diagnostic.text + 'Comment -' + diagnostic.Memo3Diagnostic.text + 'Observations -' + diagnostic.SavObs.text;

Eventually a correction of this script, thank you!

4

(8 replies, posted in General)

You can insert typed "enter" into the textRTF field, and a BOLD text like ...

Diagnostic.RichEdit1.TextRTF: = 'Error Code - \ r \ n' + # 13 + Diagnostic.EditDiagnostic.text + # 13 + 'Defect -' + # 13 # 10 + diagnostic.Memo1Diagnostic.text + 'Remedy / + diagnostic.Memo2Diagnostic.text + 'Comment -' + diagnostic.Memo3Diagnostic.text + 'Observations -' + diagnostic.SavObs.text;

Eventually a correction of this script, thank you!

5

(1 replies, posted in General)

There is a possibility to change the MEMO component with RICHEDIT menu without deleting and then creating something like the right clik.
And compatibility between the two, displaying in the table, all kinds of components in the RichEdit field.

6

(0 replies, posted in Script)

I have a string of INTELS for example, I want a script to search the database, words that contain at least 2 characters in the string, give as a result, for example, the words:
INTEL
INS
LEI
LEST
NETLIS
INT
NT

Thank you for your help!

7

(7 replies, posted in Script)

Your example helped me a true blessing, attach whichever pleases me, once again THANK YOU!

procedure Form1_TableGrid1_OnClick (Sender: string);

begin
Form1.Edit2.Text := SQLExecute ('SELECT ArdoA800X.program FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit3.Text := SQLExecute ('SELECT ArdoA800X.temperatura FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit4.Text := SQLExecute ('SELECT ArdoA800X.material FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit5.Text := SQLExecute ('SELECT ArdoA800X.GreutateRufe FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit6.Text := SQLExecute ('SELECT ArdoA800X.compartimente FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit7.Text := SQLExecute ('SELECT ArdoA800X.simbetich FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Memo1.Text := SQLExecute ('SELECT ArdoA800X.gradmurdarie FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Memo2.Text := SQLExecute ('SELECT ArdoA800X.descriereprog FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
if SQLExecute ('SELECT ArdoA800X.b1 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox1.Checked := True else Form1.CheckBox1.Checked := False;
if SQLExecute ('SELECT ArdoA800X.b2 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox2.Checked := True else Form1.CheckBox2.Checked := False;
if SQLExecute ('SELECT ArdoA800X.b3 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox3.Checked := True else Form1.CheckBox3.Checked := False;
if SQLExecute ('SELECT ArdoA800X.b4 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox4.Checked := True else Form1.CheckBox4.Checked := False;
if SQLExecute ('SELECT ArdoA800X.b5 FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) ) = '1' then Form1.CheckBox5.Checked := True else Form1.CheckBox5.Checked := False;
end;

I learned something new today! smile Of course with your help smile

8

(7 replies, posted in Script)

equivalent function:
Form1.Edit2.Text := SQLExecute ('SELECT ArdoA800X.program FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
but for function
Form1.CheckBox1.Checked ???

procedure Form1_TableGrid1_OnClick (Sender: string);

begin
Form1.Edit2.Text := SQLExecute ('SELECT ArdoA800X.program FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit3.Text := SQLExecute ('SELECT ArdoA800X.temperatura FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit4.Text := SQLExecute ('SELECT ArdoA800X.material FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit5.Text := SQLExecute ('SELECT ArdoA800X.GreutateRufe FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit6.Text := SQLExecute ('SELECT ArdoA800X.compartimente FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Edit7.Text := SQLExecute ('SELECT ArdoA800X.simbetich FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Memo1.Text := SQLExecute ('SELECT ArdoA800X.gradmurdarie FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.Memo2.Text := SQLExecute ('SELECT ArdoA800X.descriereprog FROM ArdoA800x WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );
Form1.CheckBox1.Checked ??? here I do not know how to function completes "CheckBox"
Form1.CheckBox2.Checked ....????
Form1.CheckBox3.Checked ???
Form1.CheckBox4.Checked ???
Form1.CheckBox6.Checked ???

end;

Thanks for the patience and understanding!

9

(4 replies, posted in Script)

I used version 2.7 beta function word, and it gives me an error code like when using the 'Print CV (Using templates)', with the other button works, thanks!
P.S.
using win 8.1 pro X64 + MS Office 2013 X64

10

(7 replies, posted in Script)

I do understand there are two versions of what I wanted to do, I attach a project to be understood what I wanted. for much the promptness and courtesy, a great day!

11

(7 replies, posted in Script)

I have a little puzzled how to use this line of code, my experience is at the beginning, thanks in advance.

Form1.CheckBox1.Checked := StrToBool(Form1.CheckBox1,Form1.TableGrid1.dbItemID);

Form1.CheckBox1.dbItemID := SQLExecute ('SELECT IFNULL(id_ArdoA800X, -1)FROM ArdoA800X WHERE id = ' + IntToStr(Form1.TableGrid1.dbItemID) );

12

(3 replies, posted in Script)

I do not know how to do it but I think you're right tcoton, it was analyzed in more detail in parentheses am ..
it's ((1 + sqrt (5)) / 2)) = 1.61803398874989484820 Fibonacci's golden proportion, thanks for help
can help me make a script which automatically generate Fibonacci's sequence
where F (n) = F (n-1) + F (n-2) , n>2
Example: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987

phi = F (n + 1) / F (n) = ((1 + sqrt (5)) / 2)) = Golden Ratio = 1.61803398874989484820

13

(3 replies, posted in Script)

Why this formula ...
Form1.EditA.Value := Round(2*Form1.EditAB.Value/(1+sqrt(5))) ;
give good result, and this result is different formula ...
Form1.EditA.Value := Round(Form1.EditAB.Value/((1+sqrt(5)/2))) ;
  because the mathematical point of view is the same

14

(1 replies, posted in General)

I have a puzzle, when WordWrap is activated automatically reduces the size of writing, is normal? As shown in the attached photos.

15

(2 replies, posted in Script)

Thanks for the help and promptness, it works every time. A day full of accomplishments !!!

16

(2 replies, posted in Script)

What is wrong with the procedure? Thanks!

procedure Form1_Edit1_OnChange (Sender: string);
var
DayC : integer;
begin

//Day := StrToDate(form1.Edit1.text);  ???

form1.DateTimePicker3.date := (form1.datetimepicker2.date - DayC);
form1.Label6.Caption := DateToStr(form1.DateTimePicker3.date);
end;

17

(7 replies, posted in SQL queries)

It works, you saved my day smile

18

(7 replies, posted in SQL queries)

I have one small request to help me function syntax "AS" in line "SQL .." to show my column "First Name" instead of "firstname", "Last Name" instead of "lastname"

Form1.bSQLSearch.dbSQL := 'SELECT lastname AS 'Last Name', firstname AS 'First Name', strftime(''%m/%d/%Y'', dateofbirth) as dateofbirth, id FROM employees';

Thank you again for technical support!

A great day!

19

(7 replies, posted in SQL queries)

Thanks for the help, but I found a little inconvenient for me smile make correct line for illustration

Form1.bSQLSearch.dbSQL := Form1.bSQLSearch.dbSQL + ' WHERE ' +'('+ s+')'+ ' AND (lastname LIKE "%{edLastname}%" OR firstname LIKE "%{edLastname}%")';

A great day!

20

(7 replies, posted in SQL queries)

I tried the version where I got inspiration, and I found many problems:
1. Pressing the "Select Search 'and I try to visualize data gives me invalidity ID
2. I do not manage to use the "LIKE" in the search procedure
3. disability gives me the ID if using "Print select" and "Search Select" called one after another
  Basically this is the difficulty with which I can not manage.

Thanks for the help.

21

(7 replies, posted in SQL queries)

What is wrong with the syntax of the procedure?

procedure registru_bSQLSearch_OnClick (Sender: string; var Cancel: boolean);

var
    i,c: integer;
    s: string;
begin
     s := '';
    Registru.bSQLSearch.dbSQL := 'SELECT nrordine, adresa, tipaparat, serie, producator, inst, af, ri, dataraport, datasacadenta, obs, certconf, piesa, pozlivret FROM Registru';
    c := Registru.TableGridReg.RowCount-1;

    for i := 0 to c do
    begin
        if Registru.TableGridReg.Selected[i] then s := s + 'id='+IntToStr(Registru.TableGridReg.dbIndexToID(i)) + ' OR ';
    end;

    if s <> '' then
    begin
        SetLength(s, Length(s)-4);
        Registru.bSQLSearch.dbSQL := Registru.bSQLSearch.dbSQL + ' WHERE ' + s+ 'adresa LIKE '%{Rsearch}%' OR obs LIKE '%{Rsearch}%' OR serie LIKE '%{Rsearch}%' OR dataraport LIKE '%{Rsearch}%' OR datasacadenta LIKE '%{Rsearch}%' OR certconf LIKE '%{Rsearch}% ' OR piesa LIKE '%{Rsearch}%' OR producator LIKE '%{Rsearch}%''; ///Script error ';' expected at 31:95
        //Registru.Label2.Caption := s;
    end;

end;

procedure registru_OnShow (Sender: string; Action: string);
begin
registru.TableGridReg.Options := registru.TableGridReg.Options + goMultiSelect;
end;

Thank you!
Crystal smile)

Everything is clear but the role function "SetLength" and number 4 from office "Length (s) -4"? Thank you!

SetLength(s, Length(s)-4);

24

(2 replies, posted in SQL queries)

I replaced according to your suggestion ... Thanks for saving my project.

25

(2 replies, posted in SQL queries)

SELECT
Agenda.id AS 'ID',
Agenda.Nume AS 'Nume',
Agenda.Prenume AS 'Prenume',
Agenda.Localitate AS 'Localitate',
Agenda.Numar AS 'Numar
Telefon',
Agenda.Email AS 'E-mail',
Telefon.numartelefon AS 'Telefon
FAX',
Grup.Numegrup AS 'Grup',
Agenda.Data AS 'Data
Programare',
Agenda.Activitati AS 'Activitati',
Agenda.Obs AS 'Observatii'
FROM
Agenda
LEFT OUTER JOIN Telefon ON Agenda.id=Telefon.id_Agenda
LEFT OUTER JOIN Grup ON Agenda.id_Grup=Grup.id
WHERE
(Agenda.Nume LIKE '%{Edit1}%'OR
Agenda.Prenume LIKE '%{Edit1}%' OR
Agenda.Localitate LIKE '%{Edit1}%' OR
Agenda.Numar LIKE '%{Edit1}%' OR
Agenda.Email LIKE '%{Edit1}%' OR
Agenda.Activitati LIKE '%{Edit1}%' OR
Agenda.Obs LIKE '%{Edit1}%' OR
Telefon.numartelefon LIKE '%{Edit1}%') AND Grup.Numegrup LIKE '{ComboBox1}'


Does not display any results, I tried to combine my knowledge AND the properties box office ComboBox, am I missing something really helped suggestion. Thanks a great day!