Sometimes you import data into Claris Resolve that contains currency symbols within numbers. When a number contains a dollar sign, comma, parenthesis, or (in some cases) the percentage symbol, Claris Resolve will interpret it as a text label, and not a value. Examples of such values include:
$100
1,000
(50)
The Value() function will not be of much help converting these expressions into numbers. It will either return a 0, or only the part of the number that falls before the comma (or other non-numeric character).
If you import these kinds of values often, the script below will make the task much easier. Once you attach it to a button, you help Claris Resolve interpret the imported data. Just select the data and click the button. Claris Resolve will process the selected fields and distill numeric values. This particular script will process discontiguous selections, and will preserve labels and blank cells. But be careful not to "select all" and activate the script; it will process blank cells in your document, and that would take a very long time.
{--------------------------------------------------------}
{ declare variables }
DEFINE X,RR,THEROW,THECOL,CV
{ we're going to allow for discontiginous selections.}
X = 1
{ stop redrawing the screen }
INVALIDATE ON
{ make sure we're working on a valid range }
WHILE ISREF(RANGE(REFERENCE(SELECTION(X))))
{ what's the currently selected cell range? }
RR = REFERENCE(SELECTION(X))
{ cycle through cells in the selected range }
FOR THEROW = ROWOF(RANGE(RR)) TO ROWOF(RANGE(RR)) + ROWS(RANGE(RR)) - 1
FOR THECOL = COLOF(RANGE(RR)) TO COLOF(RANGE(RR)) + COLUMNS(RANGE(RR)) - 1
CV = INDIRECT(MAKECELL(THECOL,THEROW))
{ if it's already a number, we don't need to work on it }
IF ISTEXT(CV)
{ replace common elements of formatted numbers }
CV = IF(FIND("$",CV,1),REPLACE(CV,FIND("$",CV,1),1,""),CV)
WHILE FIND(",",CV,1)
CV = IF(FIND(",",CV,1),REPLACE(CV,FIND(",",CV,1),1,""),CV)
END WHILE
CV = IF(FIND("(",CV,1),REPLACE(CV,FIND("(",CV,1),1,"-"),CV)
CV = IF(FIND(")",CV,1),REPLACE(CV,FIND(")",CV,1),1,""),CV)
{ tricky way of discerning between text and numbers. }
CV = IF(VALUE("2"&(IF(LEFT(CV,1)="-",RIGHT(CV,LEN(CV)-1),CV))&"1")=2,CV,VALUE(CV))
PUT CV INTO MAKECELL(THECOL,THEROW)
END IF
END FOR
END FOR
X = X + 1
END WHILE
INVALIDATE OFF