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
 fill/set cell of worksheet with value/data

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
asenv Posted - 06/05/2010 : 2:50:01 PM
Origin Ver. and Service Release (Select Help-->About Origin): 8.1G SR1
Operating System: Windows 2000 Pro

I have strange problem. I want to set the values of cells of worksheet. I made this loop that does not work:

win -t d 123 data1;
for(ii=1;ii<6;ii++)
{
range wksrange = [data1]1!ii;
//type "$(ii)";
for(jj=1;jj<250;jj++)
wksrange[jj]=jj;
}

Why?
The columns should be added automatically. If I make the same thing from labview (the for loops with labview) and on every iteration execute the commands (like range wksrange = [data1]1!5; wksrange[2]=2;) then it works. But not quite. It works when it is done slowly (on a slow computer). On a faster one the values of the columns in the first row are not set correctly very often. Every time is different. I presume the automatic creation of the columns takes some time that leads to not correct execution of next command which is to set data on 1st row. I do not know, but I need solution or workaround.

P.S.
I tried also with this loop:

loop(ii,1,6)
{
range wksrange = [data1]1!ii;
//type "$(ii)";
loop(jj,1,25){
wksrange[jj]=jj;}
}

Cheers
Asen
2   L A T E S T    R E P L I E S    (Newest First)
asenv Posted - 06/12/2010 : 05:50:26 AM
Thanks a lot Penn, now it works perfect.

Cheers
Asen
Penn Posted - 06/08/2010 : 04:14:23 AM
Hi Asen,

Maybe there is some thing wrong with the range definition. Substitution notation is needed here. You can try the following script.

win -t d 123 data1;
for(ii=1;ii<6;ii++)
{
	range wksrange = [data1]1!$(ii); // need $() substitution, 
    // can also use no substitution like that: range wksrange = [data1]1!wcol(ii);
	//type "$(ii)";
	for(jj=1;jj<250;jj++)
		wksrange[jj]=jj;
}

To make the command finished before the next, you can use the second command to pause for the specified number of seconds.

Penn

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