Thank you!
I will try it perhaps next week. Very busy at the moment... <sigh>... ;-)

2

(10 replies, posted in General)

@eyeman303: I added a forms.xml to my last post, so I didn't want to do it yourself ;-)

I took a look at your project and the problem is your grid. I removed it from DB_Form_010_LIST_BILL_REGISTER and it opens.

What I would do is:

  • remove the grid

  • save

  • add a new grid (NOT cut and paste).

  • save

  • run

If all is fine then step by step add new fields to the grid. After each field run your application.
When you get the error again you can say which field/setting triggered the error.

3

(2 replies, posted in General)

I can tell you, that you can do all what you like to do with MVD.
But it's not a question for a special problem ;-)

If you get an answer for that, you get nearly the whole application...

  • setting OnEnter/OnExit to form results in Access violation

  • Screen.ActiveForm not available

  • for MDI Childs: From.ActiveMDIChild not available

  • Form.Focused is always false

  • ...

Function:

function StrCrypt(txt, key: string): string;

var
  i,z: integer;

begin
  result := '';

  if Length(txt) > 0 then
  begin
    z := 1;

    for i := 1 to Length(txt) do
    begin
      txt[i] := Chr(23 XOR Ord(txt[i]));
      inc(z);
      if z > length(key) then z := 1;
    end;

    result := txt;

  end;

end;

Usage:

Procedure TestCrypt;

var
  s  : string;
  key: string;

begin
  s   := 'this is a test';
  key := '7317da37A13712';

  s := StrCrypt(s,key);
  ShowMessage('Encrypt: ' + s);
  s := StrCrypt(s,key);
  ShowMessage('Decrypt: ' + s);
end;

6

(0 replies, posted in FAQ)

You can validate GUIDs here:
http://guid.us/Test/GUID

function RightStr(txt: string; len: integer): string;
begin
  if Length(txt) > len then
    result := copy(txt, Length(txt)-(len - 1), len)
  else
    result := txt;
end;
function CreateGUID: string;

var
  ticks: integer;

begin
  ticks := Gettickcount;

  Randomize;

  result := IntToHex(StrToInt(RightStr(IntToStr(ticks),6)),6);
  result := result + IntToHex(StrToInt(RightStr(IntToStr(ticks div 1000),6)),6);

  while Length(result) < 32 do
  begin
    result := result + IntToHex(Random(16),2);
  end;

  result := Copy(result, 1, 8) + '-' +
            Copy(result, 9, 4) + '-' +
            Copy(result, 14, 4) + '-' +
            Copy(result, 19, 4) + '-' +
            Copy(result, 20, 12);

end;

7

(4 replies, posted in General)

Yes, I think so. I'm using DB Browser for Sqlite. Just for queries.and do my table definitions in MVD.
Perhaps you can try to edit tables.ini with a text editor... don't forget to backup :-)
I do this to sort my tables.

V6.2

When I call this procedure after Form.Show it doesn't find all controls. Also the control names (set by script) are not present.
After reopen the form all is fine. And yes, the procedure is called after Form.Show ;-)
I know there is some work to do on MDI Forms...

By the way:
The OnMouseMove event of TdbStringGrid can't be set by code.

procedure forms_SetOnMouseMoveOnAllControls(wctrl: TWinControl);

var
  i: Integer;

begin
  for i := 0 to wctrl.ControlCount - 1 do
  begin
    if (wctrl.Controls[i] is TWinControl) and not (wctrl.Controls[i] is TdbStringGridEx) then
    begin
      try
        wctrl.Controls[i].OnMouseMove := @forms_OnMouseMove;
      except
      end;

      if TWinControl(wctrl.Controls[i]).ControlCount > 0 then
        forms_SetOnMouseMoveOnAllControls(TWinControl(wctrl.Controls[i]));
     
    end
  end;
end;

9

(4 replies, posted in General)

AFAIK the table definitions are in tables.ini.
If you change the tables with another application you have to manually change it in MVD.

10

(2 replies, posted in General)

Can reproduce all errors.

You are right:
To delete a row should be ctrl+del or something else but not del only. If you are editing a cell you automatically press delete to delete a char not the row itself ;-)

C2
You can hit ctrl+c to copy the text and insert it into notepad or any text editor.

V6.2


  Form1.TableGrid1.OnKeyUp       := @DoSomething; //working
  Form1.TableGrid1.OnClick       := @DoSomething; //undeclared identifier
  Form1.TableGrid1.OnDoubleClick := @DoSomething; //undeclared identifier

Is it possible to have all events accessible by code?

I had the same problem with a few other events in other components, too.

12

(10 replies, posted in General)

There were a lot of crazy chars in your forms.xml file ;-)

I corrected it but some components are gone.

You can download XML Notepad and Notepad++

https://www.microsoft.com/en-us/downloa … px?id=7973
https://notepad-plus-plus.org/

You can try to open forms.xml with XML Notepad. If you get an error you get the column of the error.

Then open forms.xml with notepad++ and hit ctrl+g. Select offset and fill in the error position from XML Notepad.

Hope it helps...

V6.2

In one of my units I have a line:

ItemCaption := ReplaceStr(ItemCaption, '&', '');

When I want to load the script.dcu in "MS XML Notepad" I got an error.

So I have to change it to

ItemCaption := ReplaceStr(ItemCaption, '&#38;', '');

Don't know if it is important but found that when looking for another error.
;-)

V6.2

See the attached test project.

1. New Project
2. Add a table
3. Add grid
4. Run
5. Change grid name
6. Run
7. Look at settings.ini

TableGrid1 -> tblGrid

[Script]
Enabled=1
[Options]
DBMS=sqlite
[Grids]
Form1.TableGrid1.ColCount=2
Form1.TableGrid1.0=79
Form1.TableGrid1.1=23
Form1.tblGrid1.ColCount=3
Form1.tblGrid1.0=79
Form1.tblGrid1.1=80
Form1.tblGrid1.2=80

The type is TdbStringGridEx.

Killing me softly... ;-)

Thanks for your suggestion but...

It's declared like that:

var
  imgList16: TImageList;
  imgList32: TImageList;
  ...

and then created in main block on startup:

imgList16 := TImageList.Create(frmMain);

Its owner is frmMain, so it will be destroyed on closing main form.
It is not accesible by frmMain.imgList16 (Undeclared identifier: 'imglist16'). Perhaps it happens 'cause it's a nonvisual component and/or has no parent.

V6.20

In all other subunits (uses ...) there is no error.

e.g. TImageList -> error

with imgList16 do
begin
  Masked    :=false;
  ColorDepth:=cd32bit;
  ...
end;

e.g. with TForm -> ok.

with frmMain do
begin
  width :=100;
  height:=100;
  ...
end;

V6.20

I want to use the following code:

TdbStringGrid(frm.FindComponent('grdData')).dbUpdate;

(where frm is type TForm)

I got an error:
Undeclared identifier: 'TdbStringGrid'

I got the type from .xml file of the project. TTableGrid does not exist so.

It would also be useful to have the real component type as a header in properties grid.