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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Using $,% notation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

blt2si

Germany
37 Posts

Posted - 04/07/2003 :  09:36:50 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I am having trouble with using notations. I have datasets in a worksheet named ss1, ss2, ss3......ss8. And a display column showing the worksheet names. (Column name is "Filename"). If I put in the individual values ss1 the program works but why won't it work with "$(ii)$" which is shown below. Surely the program understands it!

loop (ii,1,8)
{
%T=Interface!Filename.V$(ii)$; //takes the wks names from columns
%A=Mapping; //Wks for graph contours
copy -x %T_ZW %A_SS"$(ii)$"; //ZW is dataset from %T
//SS1,2,3....8 is datasets from %A
copy -a %A_SS"$(ii)$" %A_SSall; //Copy all SS datasets into 1.
};

Is there something I am doing wrong??

Thanks

Blank

Mike Buess

USA
3037 Posts

Posted - 04/07/2003 :  10:30:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Blank,

The '$' symbol is required at the end of this statement...

%T=Interface!Filename.V$(ii)$; // correct as you wrote it

but it does not belong in your copy statements, which should read...

copy -x %T_ZW %A_SS"$(ii)";
-and-
copy -a %A_SS"$(ii)" %A_SSall;

I hope that helps.

Mike Buess
Origin WebRing Member
Go to Top of Page

blt2si

Germany
37 Posts

Posted - 04/08/2003 :  03:42:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

I tried this but still it does not work. I put in:

loop (ii,1,8)
{
%T=Interface!Filename.V$(ii)$;
copy -x %T_ZW %A_SS"$(ii)";
copy -a %A_SS"$(ii)" %A_ZWalle;
};

However, to check I simply replaced the "$(ii)" with 1 as follows:

loop (ii,1,8)
{
%T=Interface!Filename.V$(ii)$;
copy -x %T_ZW %A_SS1;
copy -a %A_SS1 %A_ZWalle;
};

%T is understood. It is not recognising the dataset SS"$(ii)" as SS1, SS2,.....,SS8.

I am stumped with this!

Thanx
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 04/08/2003 :  07:45:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi again,

I use that type of notation all the time and can think of no reason why it should fail. However, here are two things you could try...

1. The quotation marks are really unnecessary in this case, so try omitting them...
loop (ii,1,8)
{
%T=Interface!Filename.V$(ii)$;
copy -x %T_ZW %A_SS$(ii);
copy -a %A_SS$(ii) %A_ZWalle;
};

2. Use an intermediate string variable...
loop (ii,1,8)
{
%T=Interface!Filename.V$(ii)$;
%I=SS$(ii);
copy -x %T_ZW %A_%I;
copy -a %A_%I %A_ZWalle;
};

Mike Buess
Origin WebRing Member
Go to Top of Page

St-Ranger

USA
17 Posts

Posted - 04/09/2003 :  8:13:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I didn't have time to check this, but it might be somewhat similar to what I described in my problem under the topic "Substition doesn't work in objects/methods.".
See marko's response to it.
Go to Top of Page

blt2si

Germany
37 Posts

Posted - 04/14/2003 :  08:47:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for that Mike and St-Ranger. It works better with the intermediate string!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000