Topic: Scripts - many questions ;-)

1. Haw can I do function ..
function Plus (A:integer, B: integer) : integer
begin
  Plus := A + B
end;
doesn't work. Or
function Plus (A:integer, B: integer) : integer
begin
  Return (A + B);
end;
The same ...
The problem is haw to return the value of the function.

2. Using SQLLite - I have added new table to database by using SQL Lite but when I open the database in My Visual Database - I don't see the table. What shoul I do to see the table?

I have find solution - when you add the table manualy to db file you must change tables.ini file and it works - so just for others

3. Do you have list of all function or script manual - I am able to read russian language. Not write .. bad latters ;-) No keyboard for it ... In the manual on web is nothing about functions (Copy, IntToStr ..and so on)

4. Can I have more then one script file - If I do bigger project I need to organize it. One file si little bit strange ...

Thanks

Re: Scripts - many questions ;-)

Hello,


1.

function Plus (A, B: integer) : integer;
begin
  Result := A + B;
end;

3. Please, see screenshot for detail, where you can find list of all functions and more...
http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=97&download=0


documentation on russian: http://myvisualdatabase.com/help_ru/
Google Translated:  https://translate.google.ru/translate?h … help_ru%2F


4. You can use keyword uses for this, Example:
uses 'unit2.pas';


You should create file unit2.pas, where you can write own function:

function Plus (a,b: integer): integer;
begin
  result := a+b;
end;

begin

end.

Thanks.

Post's attachments

Attachment icon functions.png 114.13 kb, 294 downloads since 2014-07-21 

Dmitry.

Re: Scripts - many questions ;-)

1 and 3 - super, it works. But when I use other file for script, I have problem with error message

I have generla.pas file and inside your Code with function Plus
In main script file  Ihave this

begin
  uses 'general.pas';

  ShowMessage(Plus (1, 3));
end.

I have gor error:
';' expected

.. can you help please.

Re: Scripts - many questions ;-)

try this

uses 'general.pas';

begin
  ShowMessage( IntToStr(Plus (1, 3)) );
end.
Dmitry.

Re: Scripts - many questions ;-)

Doesn't work. I have already tried it.
The error message is

'BEGIN' expected

Re: Scripts - many questions ;-)

in file general.pas you should have code:

function Plus (a,b: integer): integer;
begin
  result := a+b;
end;

begin

end.
Dmitry.

Re: Scripts - many questions ;-)

super - . Have changed last . to ;  ... so Thanks a lot ..