Jump to content
CaptainBeardsEyesBeard

Function basics

Recommended Posts

CaptainBeardsEyesBeard

Hi how do I have a function that parses 2 strings 

 

I thought you would do it like this: 

Main program

Test2Add_A_Matter(ABE111, ABE118-1274576)

Function header

Func Test2Add_A_Matter(String $ClientNumber, String $MatterNumber)

but I'm getting  the below 

 

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\EliteAutomation\TestMain.au3"    
"C:\EliteAutomation\TestMain.au3" (36) : ==> Unknown function name.:
Test2Add_A_Matter(ABE111, ABE118-1274576)
Test2Add_A_Matter(^ ERROR

 

Share this post


Link to post
Share on other sites
Subz
Posted (edited)
Func Test2Add_A_Matter($sClientNumber, $sMatterNumber)

You don't have to declare the parameters as strings.  Normally I append the variable with $s to show that it is a string, see https://www.autoitscript.com/wiki/Best_coding_practices for more info

Edited by Subz

Share this post


Link to post
Share on other sites
CaptainBeardsEyesBeard

Just tried that and got this 

 

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\EliteAutomation\TestMain.au3"    
"C:\EliteAutomation\TestMain.au3" (36) : ==> Unknown function name.:
Test2Add_A_Matter(ABE111, ABE118-1274576)
Test2Add_A_Matter(^ ERROR
>Exit code: 1    Time: 5.113

 

Share this post


Link to post
Share on other sites
CaptainBeardsEyesBeard
Posted (edited)

Silly me forgot to use quotation marks 

Working now! Thanks

Edited by CaptainBeardsEyesBeard
  • Like 1

Share this post


Link to post
Share on other sites
Subz

Soz missed the quotes in the calling function.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×