Sign in to follow this  
Followers 0
leuce

Weird function call error

5 posts in this topic

G'day everyone

At a certain point in my script I get the following error:

ClipPut = $array[1]^ ERROR

Error: Error parsing function call.

There's just one problem... I don't have a function call in my script (as far as I know).

The relevant script piece is:

; Code to build an HTML file

; HTMLtemplate.txt contains three pieces of HTML code, one per line

$HTMLtemplate = FileOpen("c:\bitext\HTMLtemplate.txt", 0)
$array = StringSplit($HTMLtemplate, @CRLF, 1)

$oo1 = FileOpen ("c:\bitext\ootemp.html", 2)
FileClose ($oo1)

; aatemp.txt contains a lot of text

$ooaa = FileOpen ("c:\bitext\aatemp.txt", 0)

; eetemp.txt contains a lot of text

$ooee = FileOpen ("c:\bitext\eetemp.txt", 0)

Run ("c:\bitext\metapad.exe c:\bitext\ootemp.html")

Sleep (100)
ClipPut = $array[1]
Send ("^v")
ClipPut = $ooaa
Send ("^v")
ClipPut = $array[2]
Send ("^v")
ClipPut = $ooee
Send ("^v")
ClipPut = $array[3]
Send ("^v")

Send ("^s")
Send ("!{F4}")

Any ideas? What am I doing wrong? If I can't figure out the array, I'll just put each piece of HTML code in a separate file and take it from there...

Thanks

Samuel

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

A function always needs some sort of (). Also you can't assign a function to a variable, only a variable to a function. Hehe.

ClipPut = $array[1] ; Wrong

ClipPut($Array[1]) ; Good

edit:

I don't have a function call in my script

Your first call is FileOpen. Second is StringSplit. Last is Send. Edited by Manadar

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

...There's just one problem... I don't have a function call in my script (as far as I know)...

You don't have a User Defined Function (UDF).

ClipPut is a function.

Manadar has shown you the correct snytax for the ClipPut function... :-)

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

ClipPut = $array[1] ; Wrong

ClipPut($Array[1]) ; Good

Yes... I'm reaaaly stupid, aint I? :-) Not the first time I've made this type of error either...

Share this post


Link to post
Share on other sites

Yes... I'm reaaaly stupid, aint I? :-)...

Well if this type of mistake qualifies you as stupid --- then I'm an expert at stupidity :-)

BTW, I just threw in that bit about User Defined Function (UDF) since it took me a while to figure out when forum members were talking about functions built into AutoIt and UDFs... the terms seem to be used interchangeably.


[size="1"][font="Arial"].[u].[/u][/font][/size]

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
Sign in to follow this  
Followers 0