{{tag>category:"AREV Specific"}} [[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== String Manipulation (AREV Specific) ==== === At 24 MAR 2000 01:39:09PM Bruce wrote: === Hello, I have what should be an easy one. I have tried to use the locate to do this. I have a string 82.00-. I need to determine if the string contains a post negative sign and move it to the front before I convert the string to a decimal. I have not found a utility to locate the presence of a negative. I can do it with a for loop. Any Ideas. It would appear the Locate is capable of this. Thanks Bruce. ---- === At 24 MAR 2000 01:50PM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote: === String=82.00-' If String-1, 1=-' Then String-1,1=' String=-' : String End [url=http://www.sprezzatura.com" ]The Sprezzatura Group[/url] [i]World Leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 24 MAR 2000 01:52PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === If Value -1, 1 =-" Then    Value-1,1="    Value = "-" : Value End [url=http://www.sprezzatura.com" ]The Sprezzatura Group[/url] [i]World Leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 24 MAR 2000 05:43PM Steve Smith wrote: === LOCATE . . . seeks a value in an array, setting a variable to indiciate position within the array INDEX() is a function which looks for a character or character sequence in a string, returning the offset within the string Same concept, but one's for arrays, one's for strings. Steve ---- === At 25 MAR 2000 11:59PM Richard Hunt wrote: === Steve... if my assumptions are correct, you can use a very simple routine. If you are always going to have a number to convert, then you can do this... Given that the variable STRING=82.00-' STRING=ICONV(STRING,'MD2') STRING=OCONV(STRING,'MD2') The final result in STRING will be "-82.00". The ICONV and OCONV conversion routines will handle moving the negative sign for you. ---- === At 26 MAR 2000 03:01AM Steve Smith wrote: === Yes, Richard, you're absolutely correct. I guess Bruce now has some alternatives. The string options are the most efficient, followed by the INDEX() then the ICONV/OCONVs. We know little of the data consistency and what to expect in this context. Steve [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=3D6B49A039EDF0B5852568AC0060F7E5|View this thread on the forum...]]