Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
REVERSE RGB(0,0,0,255,255,255) to RGB(255,255,255,0,0,0)
Message
 
 
To
13/06/2003 11:19:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00799797
Message ID:
00799841
Views:
68
This message has been marked as a message which has helped to the initial question of the thread.
Tracy,
ALINES(aMyarray, CHRTRAN(oldval,"RGB() ", ""),",")
Should eliminate need for special cases.

>This is what I have so far and it works, but there must be a shorter way to do it:
>
>
>CLEAR
>set talk OFF
>set echo OFF
>set debug off
>oldval="RGB(0,0,0,255,255,255)"
>? oldval
>ALINES(aMyarray,oldval,",")
>DIMENSION part(6)
>FOR i = 1 TO ALEN(aMyarray)
>    DO CASE
>    CASE LEFT(aMyarray(i),3)="RGB"
>        part(i)=RIGHT(aMyarray(i),LEN(aMyarray(i))-AT('(',aMyarray(i)))
>    CASE AT(")",aMyarray(i))>0
>    	  part(i)=LEFT(aMyarray(i),AT(")",aMyarray(i))-1)
>    OTHERWISE
>        part(i)=aMyarray(i)
>    ENDCASE
>ENDFOR
>newval=""
>FOR i = ALEN(part,1) TO 1 STEP -1
>	DO CASE
>     CASE i = ALEN(part,1)
>          newval="RGB("+part(i)+","
>     CASE i = 1
>          newval=newval+part(i)+")"
>     OTHERWISE
>          newval=newval+part(i)+","
>      ENDCASE
>ENDFOR
>?newval
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform