Topic: this script does not work in version 5.3

indx := Trunc(random * Array_Length);

Domebil

Re: this script does not work in version 5.3

complete script

procedure Acessi_Button3_OnClick (Sender: string; var Cancel: boolean);
var
   Char_Array: array of string;
   I,PW_Length,indx,Array_Length: Integer;
   Password,AlphaNum: String;
begin
   If Acessi.Edit1.Text = '' then
     Begin
        MessageBox('Nessuna cifra inserita','Error',MB_OK+MB_ICONERROR);
        Acessi.Edit1.SetFocus;
        Exit;
     End;
   AlphaNum := 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
   Array_Length := Length(AlphaNum);
   Setlength(Char_Array,Array_Length);
   For I := 0 to Array_Length - 1 do
     Begin
       Char_Array[i] := Copy(AlphaNum,I+1,1);
     End;
   Password := '';
   PW_Length := StrToInt(Acessi.Edit1.text);
   for I := 0 to PW_Length -1 do
     begin
      indx := Trunc(random * Array_Length);
      Password := Password + Char_Array[indx];
     end;
   Acessi.edPassword.Text := Password;
end; 
Domebil

Re: this script does not work in version 5.3

Please provide more details and project.

Dmitry.

Re: this script does not work in version 5.3

I think a problem with MVDB 5.3 beta - builder.dll-issue

Re: this script does not work in version 5.3

I was using this example

http://myvisualdatabase.com/forum/viewt … 375#p20375

Domebil

Re: this script does not work in version 5.3

domebil wrote:

I was using this example

http://myvisualdatabase.com/forum/viewt … 375#p20375

replace this line

        indx := Trunc(random * Array_Length);

to

        indx := random(Array_Length);
Dmitry.

Re: this script does not work in version 5.3

Thank you Dmitrij.

Domebil