Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7618475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:24:50+00:00 2026-05-31T03:24:50+00:00

I have a for loop that cycles through the number of elements that the

  • 0

I have a for loop that cycles through the number of elements that the user has created. There are a lot of available settings in this plugin, and each element can receive it’s specific settings.

  1. User settings are entered in the following format: speed_x: “1000,500 > 1000,200 > 0,0”
    This controls the speed_x in/out for 3 separate elements. The > divides by object and the commas separate the in/out.

  2. So I can grab specific object speed_x values, I’ve split speed_x into speed_x_set (splitting by >) resulting in:

1 1000,500
2 1000,200
3 0,0`

3 Inside the loop, I grab the value by index (since it’s the object #) and split it by comma (to get speed_x_in and speed_x_out.)

for(var i=0; i<OS.numberofobjects; ++i){
   OS.speed_x_on_set[i]=speed_x_set[i].split(",")[0],
   OS.speed_x_off_set[i]=speed_x_set[i].split(",")[1],
   ...
};

Everything is assigned by object and by setting in/out correctly into the master OS settings object. T*he problem is I have many, many settings which need to be split in this fashion…* for example: delay_x_set, speed_y_set, opacity_set, etc. Their names are all based on the default setting name, with “_set” added as shown above. Hopefully this provides enough information. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:24:51+00:00Added an answer on May 31, 2026 at 3:24 am

    I would say to cache the split result

    for(var objindex=0; objindex<OS.numberofobjects; ++objindex){
       var splits = speed_x_set[objindex].split(","); //Cache the split so its does not need to be done twice
       OS.speed_x_on_set[objindex] = splits[0];
       OS.speed_x_off_set[objindex] = splits[1];
       ...
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have X number of image objects that I need to loop through in
I have a foreach loop that cycles through a list of types and creates
I have a loop that runs through a variety of websites and I'd like
I have a loop that goes through all the news items we have on
I have a loop that runs through each column and sets the value to
I have this foreach statement that is supposed to cycle through an array, but
I have a loop that reads each line in a file using getline() :
I have a loop that finds duplicate lines in a .ini file. I can
I have a loop that runs for approx. 25 minutes i.e 1500 seconds. [100
I have a loop that calculates the similarity between two documents. It collects all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.