The Code in the Run Select:

set var vmsg = ((ctxt(.%2)) & .%1)
pause 2 using .vmsg
clear var vmsg
return

Ok.. I'm back on board with this, but I am finding an oddity in passing the 
variables, as follows:
Note:  Pay attention to the comma separator(s).


Using the Code above in the Varchar Data Field

set var vtext = 'Hello World'
set var vInt integer = 99

Comma between 2 vars
R> RUN SELECT USING .vtext,.vInt SELECT cmddata from intcmd wher cmdname = 
'runkey'
-ERROR- Column or variable %2 not found (2515)
-ERROR- Expression cannot be evaluated. (2179)

Comma between and trailing 2 vars
R>RUN SELECT USING .vtext,.vInt, SELECT cmddata from intcmd wher cmdname = 
'runkey'
-ERROR- Column or variable %2 not found (2515)
-ERROR- Expression cannot be evaluated. (2179)

Comma between and 2 commas trailing LAST var
R>RUN SELECT USING .vtext,.vint,, SELECT cmddata from intcmd wher cmdname = 
'runkey'

Runs correctly and displays the concatenation of the two vars..

Passing One Var without trailing Comma

The Code in the Run Select:

pause 2 using .%1
return

RUN SELECT USING .vtext SELECT cmddata from intcmd wher cmdname = 'runkey'
-ERROR- Syntax is incorrect for the command RUN (2045)

Passing One Var With trailing Comma

R>RUN SELECT USING .vtext, SELECT cmddata from intcmd wher cmdname = 'runkey'
-ERROR- Syntax is incorrect for the command RUN (2045)


Passing One Var With 2 trailing Commas
R>RUN SELECT USING .vtext,, SELECT cmddata from intcmd wher cmdname = 'runkey'

Runs correctly and displays the %1 var.



----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, February 12, 2008 4:19 PM
Subject: [RBASE-L] - Re: Syntax for run select


> Thanks Jim. What I was missing was the delimiter between the parameters.
>
> Regards, Ken
>
> ----- Original Message -----
> From: James Bentley
> Date: Tuesday, February 12, 2008 1:44 pm
> Subject: [RBASE-L] - Re: Syntax for run select
> To: [email protected] (RBASE-L Mailing List)
>
>> RUN SELECT USING parmlist SELECT... should work just as if you
>> do a RUN commandfile USING parmlist
>> Each item in the parameter list should be separated by a COMMA
>> or current DELIMITER.
>> Say you have two parameters one is TEXT the OTHER is INTEGER
>>
>> you could RUN SELECT USING .TxtVar,.IntVar SELECT varchar clause
>> or
>> RUN SELECT USING 'txtvalue',55 SELECT...
>> or
>> RUN SLECT USING .TxtVar,55 SELECT...
>>
>> Adjust appropriately the parameter list as appropriate you can
>> have from 1 to 16 parameters
>>
>> Since the passed parameters are passed to the command file as
>> %n-? values within the command file I would immediately assign
>> them to correctly typed values for example
>> SET VAR cmdname1 TEXT = (.%1)
>> SET VAR cmdname2 INTEGER = (.%2)
>> After set the variables issue CLEAN VAR __-__ to remove the %n
>> variables. the n is 1 to 16 and ? is nesting level.
>>
>> As an asside you might consider creating some of of these items
>> as STORED PROCEDURES. With stored procedures you assign a name
>> and datatype to each procedure. You then don't have to type the
>> paramater values within the command. You would then use the
>> CALL procname (.parm1,.parm2) syntax.
>> You cn use a mixture a variable or actual values for the
>> parameter list of the CALL statement just as you do with the
>> above mentioned RUN syntax.
>>
>> Jim Bentley
>>
>>
>>
>> --- Lawrence Lustig wrote:
>>
>> > <<
>> > It
>> > is
>> > for
>> > calling
>> > (legacy
>> > use)
>> > a
>> > "command
>> > Block"
>> > that
>> > is
>> > a
>> > part
>> > of
>> > a
>> > "procedure
>> > file".
>> > >>
>> >
>> > Uh oh! Have multi-block procedure files been deprecated?
>> > What do you mean by "legacy" use?
>> >
>> >
>> > BTW, this syntax is in the latest help file that I checked:
>> >
>> > RUN SELECT USING parmlist SELECT VARCHAR clause
>> >
>> > --
>> > Larry
>> >
>> >
>> >
>>
>>
>> Jim Bentley
>> American Celiac Society
>> [EMAIL PROTECTED]
>> tel: 1-504-737-3293
>>
>>
>>
>> ____________________________________________________________________________________Never
>>  
>> miss a thing. Make Yahoo your home page.
>> http://www.yahoo.com/r/hs
>>
>>
>>
> 


Reply via email to