[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

[sqr-users] Global VS parameter list



> Hi, 
> 
> I am supposed to modify an SQR report by adding a procedure to it.
> When I add my procedure I passed in a couple of parameters and 1 as return
> parameter.
> Within that procedure I am also referencing some field variables that I
> retrieved earlier.
> 
> However it errored out and complained that the &xxxxx variables that I'm
> referencing are not declared.
> Later I found out that I have to put those variables that I want to use in
> the parameter list of the procedure to make it work.
> 
> For example:
> 
> begin-report
>   let $aa = 'A'
>   let $bb = 'B'
>   do sel
>   do main($aa,$bb)
> end-report
> 
> begin-procedure sel
> begin-select
> 'TESTING'     &dummy
> from dual
> end-select
> end-procedure
> 
> begin-procedure main($in_aa,$in_bb)
>   print $in_aa (1,1)
>   print $in_bb (+1,1)
>   print &dummy (+1,1)
> end-procedure
> 
> 
> 
> When you run it:
> 
> 
> 
> SQR V6.1.4
> Copyright (C) Brio Technology 1994-2000.  All Worldwide Rights Reserved.
> 
> (SQR 4407) Referenced variables not defined:
> 
>   &dummy (local)
> 
> Errors were found in the program file.
> 
> 
> 
> 
> This is the version that runs:
> 
> begin-report
>   let $aa = 'A'
>   let $bb = 'B'
>   do sel($dummy)
>   do main($aa,$bb,$dummy)
> end-report
> 
> begin-procedure sel(:$ret_dummy)
> begin-select
> 'TESTING'     &dummy
> from dual
> end-select
> 
> let $ret_dummy = &dummy
> end-procedure
> 
> begin-procedure main($in_aa,$in_bb,$in_dummy)
>   print $in_aa (1,1)
>   print $in_bb (+1,1)
>   print $in_dummy (+1,1)
> end-procedure
> 
> 
> 
> 
> 
> Is there any way to get around?
> 
> What if I have an array to reference? Can I pass it in as a parameter
> list?
> 
> 
> Many thanks!!
> Nicholas

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users