SynthMaker

Parser to yield index of position in comma delim string list

Archive · 2006 10 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

oddson ·

Can anyone good at the parser components give me a module that would return an index integer to where in a list of comma delimited items a given text match was found?

Inputs 1) comma delimited string of items 2) comparison string

Output 1) index integer of found position 2) boolean success indicator

alternately 0 = not found and a non-zero position indicator

oddson ·

Forgot to say PLEASE! 🙂 😇

I might be able to do this myself but it will take 10 times as long... I need it to fix the TableSynth!

I don't care if it's the parser but I'd like to avoid any loop solutions as the last thing TableSynth needs is something slowing down wave loads.

dasdeck ·

? 😉 (sounds like the findstring component to me)

D3CK

oddson ·

That finds the character position in a string. I need the item number in a comma delimited list. (Does anyone remember HyperCard?)

dasdeck ·

of cousrse, sorry, forgive me........ I'll build sometihn for you now. 😉

D3CK

dasdeck ·

http://rapidshare.de/files/18688500/4oddson.osm.html

is this what you want? the connectors are a bit different to waht you want, they follow my own standart.

😉

D3CK

oddson ·

Great... thank you... if it's not exactly what I need I can certainly make it work. I'm just a little weak with the parser components.

Thanks again. 🙂

rl ·

not tried yet, but I could think about another way: use the "normal" string components, search for the ',' - delimiter, split into left and right string, if found: increase counter by 1 and feed the right-hand string (the rest) back into the schematic (using a StringSwitch) thus basically using recursion.

dasdeck ·

what would be more efficient? i would think the parser is very efficient, but how is it? can you tell please?

😇

D3CK

oddson ·

Your solution worked well enough for what I was trying... unfortunately the underlying method I was using didn't work quickly enough (it involved a large number of wireless connectors to move table data around).

I can't see how rl's would work without the loop component and, in general, looped behaviour can be slow. If you were extracting an item from a list for a user interface issue once in a while either would be fine. I assume yours would be quicker for something called many hundreds of times as it was in the thing I was trying -- but I never tried to build rl's alternative.

Your help is greatly appreciated as without it I would not know I was going up a blind alley... even though it's not going to be in the finished product it helped.

Thanks again.

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.