The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 inserting arrows using script

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
zknauss Posted - 01/24/2023 : 11:29:42 AM
Good afternoon, I have the below script which I'm using to sort data based on pattern of change. Currently its operating how I intended but instead of outputting letters I'd like it to output Arrows representing the direction of change specifically what I'd like to have it output is below:

A = up arrow, color (red), shortcut key code: 2191
B = horrizontal bar, color (black), code: 2015
C = down arrow, color (blue), code: 2193

Thanks in advance for any help with this

for (int i = 1; i <= wks.ncols; i++ ){ range aa = [NCONFreReg]"Frequency_T1"!$(i+1); range bb = [NCONFreReg]"Frequency_T2"!$(i+1); %j=wcol(i)[1]$;
wcol(i)[2]$ =

if(bb[1]>0.01&&bb[1]>=aa[1]&&bb[2]<=aa,"A",

if(bb[1]>0.01&&bb[1]>=aa[1]&&aa==0&&bb[2]!=0,"A",

if(bb[1]>0.01&&bb[2]>aa && bb[2]<aa[9] && %j!="B","B",

if(bb[1]>0.01&&bb[1]<aa[1] && bb[2]>aa[9] && %j!="B","C","I")$)$)$)$; }


ZTK
6   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 01/24/2023 : 5:30:45 PM
1. You are missing the dollar sign. Try: col(1)[1]$=↑
2. set font color: wcellcolor type:=1 irng:=col(B) color:=2
zknauss Posted - 01/24/2023 : 4:00:55 PM
Also is there a way to set the color of the arrow/symbol created? Thanks!

ZTK
zknauss Posted - 01/24/2023 : 3:52:59 PM
I'll give it a try in my script would the " " be nessasary for this to work? I tried using, col(1)[1]="↑"; and col(1)[1]=↑; but got a error message or an output of -- in the designated cell.

ZTK
YimingChen Posted - 01/24/2023 : 3:33:44 PM
It works to include unicode symbols in the script. See below:
zknauss Posted - 01/24/2023 : 2:34:45 PM
I'm not sure how I'd impliment that in the for/if statment or pull other symbols such as a horizontal bar.



ZTK
YimingChen Posted - 01/24/2023 : 2:02:51 PM
Maybe you can use the Xfunction insertArrow:
https://www.originlab.com/doc/X-Function/ref/insertArrow


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000