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
 printing and comparing a string with special char

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
Xlsx Posted - 05/27/2023 : 3:29:09 PM
OriginPro 2023 (64-bit). and Service Release (10.0.0.154):
Operating System: Windows 10

Hi Origin Team,
I'm attempting todo a string comparison of the contents of one of my columns so I can preform further steps if its a match, However the imported Data contains the special '%' character which it interprets as a string register. How can I escape this so that it treats it like a regular string?
Example Column I'm referencing:



for(int ii = 1; ii < wks.ncols; ii+=1 )
{
string column$ = wcol(ii)[C]$;

int compareStrings = Compare(column$, 'Baseline 100%T',1);
type $(compareStrings);
}

Thank you for your help,
Robbie
2   L A T E S T    R E P L I E S    (Newest First)
Xlsx Posted - 06/22/2023 : 11:14:32 PM
quote:
Originally posted by cpyang

There might be a system variable to disable such substitutions, but you can always prevent % substitution by using %%, like


Compare(column$, 'Baseline 100%%T',1);


CP



Thank you!

Robbie G
cpyang Posted - 05/28/2023 : 07:47:14 AM
There might be a system variable to disable such substitutions, but you can always prevent % substitution by using %%, like


Compare(column$, 'Baseline 100%%T',1);


CP

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