Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

change_section ( string ; pos ; to ; delimiter )


This topic is 6213 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Name & Parameters: [color:red][big] change_section ( string ; pos ; to ; delimiter ) [/big]

Description: For the given arguments this function will return a string with the given section changed to what argument "to" is set to.

string = The string to be altered

pos = The section you wish to be changed (1=the first section)

to = What the section will be changed to

delimiter = The section definer

For the delimiter, it is recommended to use one character long delimiters, for FM returns unconsistent values. This isn't saying it won't work, just don't count on it.

Sample Input:

change_section ( "1.23.53.1.3.2" , 4 , "102" , "." )

Results:

1.23.53.102.3.2

Recursive: no

Formula:

Let ([

$cfstr = string;

$cfstr = Substitute ( $cfstr ; delimiter ; "¶" );

$cflen = Length (GetValue( $cfstr ; pos ));

$cfposition = Position ( "¶" & $cfstr ; "¶" ; 1 ; pos );

$cfstr = Replace ( $cfstr ; $cfposition ; $cflen ; to )

];

Substitute ( $cfstr ; "¶" ; delimiter )

) 

Required Functions:

Author(s):) Julian L

Date: 11/20/07

Credits:

Disclaimer:

FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.

Edited by Guest

This topic is 6213 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.