Thank you!
I will try it perhaps next week. Very busy at the moment... <sigh>... ;-)
1 2020-01-21 17:21:45
Re: TableGrid: Cannot set some events by script (undeclared identifier) (2 replies, posted in Script)
2 2020-01-05 15:16:51
Re: Invalid character error (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 2020-01-02 08:19:48
Re: quiz (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...
4 2019-12-31 09:04:14
Topic: How can I check if a form is activated/focused? (0 replies, posted in Script)
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
...
5 2019-12-31 07:46:51
Topic: [Script] Simple encrypt and decrypt string (0 replies, posted in FAQ)
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 2019-12-31 07:26:07
Topic: [Script] Create GUID (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 2019-12-29 23:21:35
Re: Editing SQlite with Navicat (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.
8 2019-12-29 23:07:54
Topic: Controllist of MDI child form not set after Form.Show (0 replies, posted in Script)
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 2019-12-29 22:30:56
Re: Editing SQlite with Navicat (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 2019-12-29 13:33:48
Re: different grid issues (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.
11 2019-12-28 07:10:16
Topic: TableGrid: Cannot set some events by script (undeclared identifier) (2 replies, posted in Script)
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 2019-12-27 22:41:33
Re: Invalid character error (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...
13 2019-12-27 05:14:53
Topic: Using '&' char in code can produce not correct xml (script.dcu) (0 replies, posted in Script)
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, '&', '');
Don't know if it is important but found that when looking for another error.
;-)
14 2019-12-27 05:03:42
Topic: settings.ini not written correctly when changing grid name (0 replies, posted in General)
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
15 2019-12-21 18:38:33
Re: TableGrid: Unknown identifier in script (1 replies, posted in Script)
The type is TdbStringGridEx.
Killing me softly... ;-)
16 2019-12-21 12:52:58
Re: Using "with...do" causing Stack overflow in main script (2 replies, posted in Script)
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.
17 2019-12-20 15:51:39
Topic: Using "with...do" causing Stack overflow in main script (2 replies, posted in Script)
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;
18 2019-12-20 15:34:46
Topic: TableGrid: Unknown identifier in script (1 replies, posted in Script)
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.