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
 Issue combining strings with /

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
Clairekun Posted - 06/16/2022 : 7:46:36 PM
Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: Windows 10

Hello,

I am trying to define a series of strings extracted from graph names, in order to move those graphs to their corresponding folders.

An example of a graph name is: gdH1p5z650C

I want to check for the left and right parts of the name; one will define the parent folder, and the other will define the child folder to move to.

string gName$ = page.name$;
string FvarDSC$="ZnO-Temp-Var DSC";
string gFol1$; 
string gFol2$;
string gFol$="/%(gFol1$)/%(gFol2$)"; //Parent/child folder path

if (Left(gname$,3)$ == "gdH") 	gFol1$ = "DSC";
if (Right(gName$,1)$ == "C")	gFol2$=%(FvarDSC$);

I tried to use pe_move command, but an error popped up stating that the graph couldn't be moved to "//". Apparently, it is not reading the strings correctly for gFol$.

The results I obtained in my test is:

gFol1$=; 
gFol2$=;
gFol$=;

DSC
ZnO-Temp-Var DSC
//

However, this changes the active folder correctly:

//From any folder
pe_cd path:=gFol$;

I have used
pe_move path="/%(string$)"
successfully in previous ocassions.


What am I doing wrong? Thank you.
2   L A T E S T    R E P L I E S    (Newest First)
Clairekun Posted - 06/17/2022 : 7:06:09 PM
I moved it right before defining gFol1$ and gFol2$, and it worked. Thanks for the advice, that solution would nave never even crossed my mind.

Why, though? I would think that it's necessary to define all components contained in a string such as gFol$ beforehand.

EDIT: Encountered another error when applying the command pe_move.

While the strings alone seemed to work if gFol$ was placed before the others, pe_move generated the error: Undefined Variable gFol1$, so I assumed gFol1$ and gFol2$ would still need to be defined before gFol$.

What I did was define string gFol$ right before pe_move; that is, after gFol1$, gFol2$ and all conditions.

This is what finally worked.
YimingChen Posted - 06/17/2022 : 08:45:06 AM
Do you need to move the line string gFol$="/%(gFol1$)/%(gFol2$)"; to the end after gFol1$ and gFol2$ are assigned?

James

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