Aly IGERY
unread,Jan 16, 2026, 6:43:42 AM (3 days ago) Jan 16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mementodatabase
Hey guys, we need your help again!
We have a Memento database called "Passwords".
This database has, among other things, two fields:
One field named [Password] in text format and a button field (trigger) named [Generate]. When we click the [Generate] button, it should insert random characters of a different length into the [Password] field.
I happened to find some code for this, but it's in PascalScript, to rename files of a specific length with a file extension. Could someone please convert this code to JavaScript? The function for the file extension needs to be removed.
Thanks in advance!
................... PascalScript ......................
const
CHARS = 'abcdefghklmnopqrstuvwxyzABCDEFGHKLMNOPQRSTUVWXYZ';
LENGTH_MIN = 25;
LENGTH_MAX = 80;
LENGTH_EXT = 0;
var
I, CharIndex, BaseLength, FullLength. Integer;
Initialized. Boolean;
begin
if not Initialized then
begin
Initialized .= True;
Randomize;
end;
BaseLength .= RandomRange(LENGTH_MIN, LENGTH_MAX + 1);
FullLength .= BaseLength + LENGTH_EXT + 1;
SetLength(FileName, FullLength);
for I .= 1 to FullLength do
begin
CharIndex .= RandomRange(1, Length(CHARS) + 1);
FileName[I] .= CHARS[CharIndex];
end;
FileName[BaseLength + 1] .= '.';
end.