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
 Values won't refresh/get deleted when 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
zaph0d Posted - 11/09/2015 : 2:52:31 PM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2015G (32-Bit) Sr2
Operating System:Mac OsX

Hi I'm getting a pretty strange behaviour when using custom functions in a worksheet.
I'm trying to execute the following script:

CountnumberFromChannel(col(A)) / (HeNumber * DetectorSolidAngle * WQFromDepth(DepthFromEnergy(EnergyFromChannel(col(A)))))

with
Function double EnergyFromChannel(int channel) {
  return channel * 1,708 + 15,1;
}

Function double DepthFromEnergy(double energy) {
  return (1491.325 - energy) / 0.52236;
}

Function double WQFromDepth(double depth) {
  return (4.73 + depth * 0.0014 + depth^2 * 5.71429e-7) * 1e-24;
}

Function double CountnumberFromChannel(int channel) {
  return 0.29619 + 9766.6711 / ( 28.42699 * sqrt(pi / 2)) * exp(-2 * (channel - 801.57007)^2 / 28.42699^2);
}

Const HeNumber = 2e-5 / (1.60217646e-19);
Const DetectorSolidAngle = 3.362e-3;

as the script inserted. I imported this project from a colleague with colums depending on the coloumn of this script. But after I used str+q to look at the script and pressed ok all the column values vanished to --(on my partners computer it works just fine he's using the same version on windows!). What is causing that behaviour?
1   L A T E S T    R E P L I E S    (Newest First)
AmandaLu Posted - 11/10/2015 : 03:59:52 AM
Hi zaph0d,

Please check the separator Origin uses. I am not sure if you use E version virtual Windows, which uses "." as separator by default. The script you provided uses "," as separator. It may cause problem in an E OS. You can select Tools: Options from Origin menu, activate Numeric Format tab and set Separators as "1.000,0". Then run the script again and see if it works.

Thanks,
Amanda
OriginLab Technical Service

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