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 for Programming
 LabTalk Forum
 Help with script? Comand error

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
HAMOS Posted - 12/09/2012 : 1:08:46 PM
Hello there,
I try to run the following script but I keep getting a command error that starts in the marked section .. can somebody please help me out to find where the problem is?

//////////////////////////////////////////////////////////////////////


stringarray sa_state; //string array where all OC and ISC will be stored
stringarray sa_SC; // string array were the values of columns corresponding to the SC will be stored
stringarray sa_OC; //string array were the values of columns corresponding to the SC will be stored

int ii=count(Col(Potential/V),1); // count n of data values and set the maximum


for (jj=1; jj<ii; jj++) //Loop between those values
{

if (Col(Potential/V)[jj]*Col(Potential/V)[jj+1]<0) // short circuit condition
{
short_circuit$=$(jj);
sa_state.Add(short_circuit$); //add value to string array
//short_circuit$=;
};


if (Col(Current/A)[jj]*Col(Current/A)[jj+1]<0) // open circuit condition
{
open_circuit$=$(jj);
//open_circuit$=;
sa_state.Add(open_circuit$);
};
}; //EVERYTHING IS OK until here



for (kk=1; kk<=sa_state.GetSize(); kk++) //print the string array
{
%A= sa_state.GetAt(kk)$;
%B= sa_state.GetAt(kk+1)$;
int state= %A;
int state_1= %B;
//state=;
//state_1=;
}; //COMMAND ERROR STARTS when I run this part


//find conditions where short circuit condition is followed by an open circuit and determine short cicuit current and open circuit values

if (Col(Potential/V)[state]*Col(Potential/V)[state+1]<0 && Col(Current/A)[state_1]*Col(Current/A)[state_1+1]<0)
{
double ISC=Col(Current/A)[state];
double VOC=Col(Potential/V)[state_1];
string row$=$(state);
string row_1$=$(state_1);
//row$=;
//row_1$=;
sa_SC.Add(row$);
sa_OC.Add(row_1$);
};
};

for(int ll=1; ll<=sa_SC.GetSize(); ll++)
{
%C= sa_SC.GetAt(ll)$;
%D= sa_OC.GetAt(ll)$;
int sc= %C;
int oc= %D;
sc=;
oc=;

};
//////////////////////////////////////////////////////
2   L A T E S T    R E P L I E S    (Newest First)
doxera Posted - 12/10/2012 : 11:02:23 AM
Hi!
Hamos, try this string in a new project, maybe it's an answer:
type -b %C;

and this too
type -b %D;

Also, I think it's not correct to give string to integer:
int sc= %C;
int oc= %D;

use the:
int YourInteger = %(YourArray.GetAt(ll)$);
HAMOS Posted - 12/09/2012 : 1:23:59 PM
Ok already figured out what the problem was..

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