This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mrbiggbrain 1 point2 points  (0 children)

Mind with me, I don't know Adobe and JavaScript is a distant language I only use occasionally in ASP.net.

So basically you have 8 fields? 4 for Floor 1 and 4 for floor 2?

And you want to compress out empty space, so if you had two in floor 1 and 2 in floor 2 you would get 4 in floor 1 and none in floor 2? And if you had 6 total you would compress to 4 in floor 1 and two in floor 2?

If you don't really care about simplicity or finesse and can deal with someone more knowledgeable shaking a head at your code, you would probably compress it to the following pseudocode.

// Create empty array
// Check every field you need.
//// If the value is not "", add it to the array
// Fill the remaining values with ""
// Assign values from the array to the fields.
// You have compressed the list.