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
 Expressing strings between { }

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
jc001 Posted - 12/19/2001 : 10:12:59 AM
Has anyone any idea how to force Origin
to express a String variable in a command
taking a script argument between {}?

I have a loop where menu commands are
created, I want to create a generalized script associated with each command.

Something like:
...
%T=;
menu (New Command) {%T};
...

%T remains unexpressed in the newly created command.

Any ideas? Thanks.
3   L A T E S T    R E P L I E S    (Newest First)
jc001 Posted - 12/20/2001 : 12:47:06 PM
Apologies, my previous reply was misformatted, here it is again:

Thankyou, after a bit of head scratching I pretty much hit upon the same solution.

I have found a similar type of behaviour when searching text strings. The undocumented structure %[%A,"search string"], returns text in %A to the right of 'search string' when it finds it in %A, but will return NULL when 'search string' is anything but an explicit string, i.e.
%B="search string";
%[%A,"%B"]=;
--
even if 'search string' occurs in %A.

I haven't found a work around for this at present.
jc001 Posted - 12/20/2001 : 12:41:48 PM
Thankyou, after a bit of head scratching I pretty much hit upon the same solution.

I have found a similar type of behaviour when searching text strings. The undocumented structure %[%A,""], returns text to the right of the when it finds it in %A, but will return NULL when is anything but an explicit string, i.e.
%B="";
%[%A,"%B"]=;
--
even if occurs in %A.

I haven't found a work around for this at present.
Mike Buess Posted - 12/19/2001 : 1:56:46 PM
I don't think you can do that, but you can accomplish the same thing with menu IDs and an INI file. For example, say that you want to add three new menu commands to the Tools menu in Origin.

First create an INI file like this...

;MyMenus.ini
[Config]
numCmds=3
Cmd1=First Command
Cmd2=Second Command
Cmd3=Third Command


Next create a script file...

// MyMenus.ogs
[MakeMenu]
menu -w; menu ?To;
ini.get.filename$=%YMyMenus.ini;
loop(ii,1,ini.Config.numCmds) {
%A=ini.Config.Cmd$(ii)$;
menu (%A) {run.section(MyMenus,Execute)};
ini.Config.ID$(ii)=menu.lastID;
};
[Execute]
ini.get.filename$=%YMyMenus.ini;
loop (ii,1,ini.Config.numCmds) {
if(ini.Config.ID$(ii)==i) break;
};
run.section(,Cmd$(ii));

[Cmd1]
// First Command scripts...

[Cmd2]
// Second Command scripts...

[Cmd3]
// Third Command scripts...
The MakeMenu section adds the following items at the end of the Tools menu and records their menu IDs in MyMenus.ini.

First Command
Second Command
Third Command

When the user selects one of these commands its menu ID is passed via the variable 'i' to the Execute section, which then runs the appropriate command scripts. Normally its easier just to create the menu items explicitly...
menu (First Command) {run.section(MyMenus,Cmd1)};
menu (Second Command) {run.section(MyMenus,Cmd2)};
etc.
But there have been a few situations where I've found this method quite useful.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 12/19/2001 13:58:42

Edited by - Mike Buess on 12/19/2001 14:03:29

Edited by - Mike Buess on 12/19/2001 14:04:59

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