Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview script line error

hi All,

i am coding in Qlikview 11 and i have written and i received  a "Script line error" just after a CALL like this

    

     CALL my_proc('param_1','param_2')

i have no idea why, someone have some suggestion?

thanks a lot.

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

I'll answer my own question: Probably not.

The following code executes perfectly:

SUB my_proc(vParm1)

  SET vFlag = ProcDef1;

END SUB

SUB my_proc(vParm1001)

  SET vFlag = ProcDef2;

END SUB

CALL My_Proc('val1');

And variable vFlag will contain 'ProcDef2', meaning that the last definition is being executed. It's not just the fact that you defined your SUB twice that causes this error.

View solution in original post

15 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Is subroutine my_proc defined before the CALL statement? QlikView does not perform a lookahead, or a preparsing step. The subroutine should already exist before you can make use of it.

Anonymous
Not applicable
Author

Not applicable
Author

yes, i have declare before calling, the strange things is that i have different part in my script that has the same structure and all other part work well; is only this part that as this problem.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Check the number of parameters. Does my_proc really expect two parameters?

Kushal_Chawda

what is the definition of subroutine? what actually subroutine does?

Not applicable
Author

this is the call

  • CALL My_Proc('$(v_variable)','out_one.qvd','out_two.qvd','done','[Field_one],[Field_two]')

this is the declaration

  • sub My_Proc(p_source,p_out_oneN,p_out_twoN,p_typeN,p_fields)

as type of calling is the same of other (i mean that i have other routine that work the same as this with the same parameters) but this is the only that give me problem the others give me correct output.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

So what's in v_variable at the time of the CALL? I hope it doesn't contain any strings with quotes.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If you want to be sure what exacly the CALL statement-with-parameters looks like at the time of execution, generate a document log and search for the Script line error message in that log. The $-sign expanded CALL statement will precede the error message.

Not applicable
Author

v_variable contain a source:

is like this:

..\Datasource\sourcefile.qvd

it doesn't have quotes inside.