Jump to content
unavailable

Wordbank

Recommended Posts

Hey, thanks man!

 

The first line makes Compiler Error; Identifier expected?

 

Im trying to make something like this:

 

function GetRandomWord() : string;
var
 words : TStrArray;
begin
 words := ['Apple', 'Banana', 'Peach', 'Blueberry'];
 result := words[Random(length(words))];
end;


TypeText(GetRandomWord());
Wait(random(500));
TypeText(#13);

Link to comment
Share on other sites

Hey, thanks man!

 

The first line makes Compiler Error; Identifier expected?

 

Im trying to make something like this:

 

function GetRandomWord() : string;
var
 words : TStrArray;
begin
 words := ['Apple', 'Banana', 'Peach', 'Blueberry'];
 result := words[Random(length(words))];
end;


TypeText(GetRandomWord());
Wait(random(500));
TypeText(#13);

 

All I have given you was the function that you can now select random words from.

You will still need your "main" being and end of the entire program.

So your code, that it looks like you are trying to do is something like this:

 

function GetRandomWord() : string;
var
 words : TStrArray;
begin
 words := ['Apple', 'Banana', 'Peach', 'Blueberry'];
 result := words[Random(length(words))];
end;

begin
 TypeText(GetRandomWord);
 Wait(random(500));
end.

Link to comment
Share on other sites

The very first line still produces compiler error:

function GetRandomWord() : string;

 

"Identifier expected"

 

Im using SCAR 3.41

 

 

EDIT: Never mind figured it out starting from the buttom, and adding on what I wanted. :)

Thanks for the help guys!

Edited by unavailable
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...