Buddy:
I was ready to post a little snippet of code with a loop similar to the one
that David posted, but I got to admit that yours is very clever, much
simpler and more importantly, it work perfectly. A nice addition to the tool
arsenal.
Javier,
 
Javier Valencia, PE
President
Valencia Technology Group, L.L.C.
14315 S. Twilight Ln, Suite #14
Olathe, Kansas 66062-4578
Office (913)829-0888
Fax (913)649-2904
Cell (913)915-3137
================================================
Attention:
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material.  Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the sender and
delete the material from all system and destroy all copies.
======================================================
 
-----Original Message-----
From: Walker, Buddy [mailto:[EMAIL PROTECTED] Behalf Of Walker, Buddy
Sent: Monday, July 04, 2005 7:47 AM
To: RBG7-L Mailing List
Subject: RE: [RBG7-L] - RE: Choose problem
 
Claudine
 
   Once you set variable V2 you must execute it by using &V2
 
  Here is a little code you can use to test.
 
*********************TestFile.RMD************************
CLE ALL VAR
CLS
SET VAR vmilelist TEXT  = ('(3,4,5)')
SHOW var vmilelist
SET VAR V1 = (SRPL(.vmilelist,',','+',0))
SHOW VAR v1
SET VAR V2 TEXT = ('SET VAR VTotal =' & .v1)
SHOW VAR v2
&v2
SHOW VAR vtotal
*************End Test File******************
 
 
  
   
 
 
  _____  

From: [email protected] on behalf of Claudine Robbins
Sent: Sun 7/3/2005 9:38 PM
To: RBG7-L Mailing List
Subject: [RBG7-L] - RE: Choose problem
Buddy,

I'm intrigued.  I'm trying this and all I get is:

vmilelist          = (3,4,5)                                  TEXT   
V1                 = (3+4+5)                                  TEXT   
V2                 = SET VAR VTotal = (3+4+5)                 TEXT

VTotal is not being evaluated.

Claudine

________________________________________
From: [email protected] [ mailto:[email protected] <mailto:[email protected]> ]
On Behalf Of Walker, Buddy
Sent: Saturday, July 02, 2005 9:44 PM
To: RBG7-L Mailing List
Subject: [RBG7-L] - RE: Choose problem

Claudine
  If your variable is always coming back as (3,5) then you could do this
 
 Assuming your variable V1 is text and has a value of  '(3,5)'
 
R>SET VAR V1 = (SRPL(.V1,',','+',0))
R>SHO VAR V1
(3+5)
R>SET VAR V2 = ('SET VAR VTotal =' & .v1)
R>sho var
Variable           = Value                                   Type
------------------   ------------------------------          --------
#DATE              = 07/02/2005                               DATE   
#TIME              = 22:38:31                                 TIME   
#PI                = 3.14159265358979                         DOUBLE 
SQLCODE            = 0                                        INTEGER
SQLSTATE           = 00000                                    TEXT   
V1                 = (3+5)                                    TEXT   
V2                 = SET VAR VTotal = (3+5)                   TEXT   
 
R>&v2
R>sho var
Variable           = Value                                   Type
------------------   ------------------------------          --------
#DATE              = 07/02/2005                               DATE   
#TIME              = 22:38:40                                 TIME   
#PI                = 3.14159265358979                         DOUBLE 
SQLCODE            = 0                                        INTEGER
SQLSTATE           = 00000                                    TEXT   
V1                 = (3+5)                                    TEXT   
V2                 = SET VAR VTotal = (3+5)                   TEXT   
VTotal             = 8
 

________________________________________
From: [email protected] on behalf of Claudine Robbins
Sent: Sat 7/2/2005 7:11 PM
To: RBG7-L Mailing List
Subject: [RBG7-L] - Choose problem
Hi everyone,

I have a simple goal:

01. Pick two or more choices from a view, return integer values strung along
in a text variable

02. Somehow transform the values inside the variable back into integers and
add them up

So far, this is what I have:

CHOOSE vmilelist FROM #VALUES FOR DISTINCT (loc_desc &
(ctxt(plusminus))),plusminus +
FROM v_plusminus +
WHERE active_fl_28 = 'Y' +
ORDER BY loc_desc +
CHKBOX 0 +
TITLE 'Add Mileage' +
CAPTION 'LOCATIONS PLUS MINUS MILES' +
LINES 25 +
FORMATTED
SET VAR  vmilelist = ('(' + .vmilelist + ')')

My choose looks like this:

DULAC-LA 3     <===
REDDELL-LA 8
MAMOU-LA 11
FRANKLIN-TX 5  <===

The value returned is 3 and 5 and the text variable vmilelist looks like
this: (3,5)

The result I want is integer 8, i.e. the sum of 3 and 5.

Can I get there from here?

TIA,

Claudine :)

--- RBG7-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================

<<attachment: winmail.dat>>

Reply via email to