Old 09-10-2014, 07:55 AM   #1
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,924
Default Strings & functions in EEL

Is there any way of passing strings to an EEL function that anbody knows of please?

There are some common functions in a piece of code I'm trying to simplify, and I'd like them to use the string I send them, and not have to have a duplicate version for each string variable.

I know the implementation is numeric-orientated, but I struggle with this limitation quite often.

Many thanks...



>
__________________
Nathan, Lincoln, UK. | Item Marker Tool. (happily retired) | Source Time Position Tool. | CD Track Marker Tool. | Timer Recording Tool. | dB marks on MCP faders FR.
planetnine is online now   Reply With Quote
Old 09-12-2014, 03:37 AM   #2
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
Default

Like this?

Code:
@init

// Strip whitespace from end of string
function rtrim(x)
	local(c, p)
(
	p = strlen(x);
	while (p >= 1 && ((c = str_getchar(x, p - 1)) == ' ' || c == '\t')) ( p -= 1 );
	str_setlen(x, p);
);

#s1 = "String      ";
#s2 = "STRING            ";

before1 = strlen(#s1);
before2 = strlen(#s2);

#s1 = rtrim(#s1);
#s2 = rtrim(#s2);

after1 = strlen(#s1);
after2 = strlen(#s2);
IXix is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.