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 4594586
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:50:57+00:00 2026-05-21T22:50:57+00:00

I have a bunch of variables in a class. There are situations when I

  • 0

I have a bunch of variables in a class. There are situations when I want to set then to null/ “temp” etc as per a well defined logic. The challenge is to list out the variables at multiple places- tedious and error-prone.

classname.speed=NaN

classname.speedtype=”not_set”

classname.distance=NaN

classname.distancetype=”not_set”

Ideally, would prefer a way to refer to these variables programatically and set something like
“for all class variables- if variable ends in type, set as “not_set”; for other variables set as NaN

How can I achieve this? Any pointers will help

  • 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-21T22:50:58+00:00Added an answer on May 21, 2026 at 10:50 pm

    The simplest approach would be just write function to clear them all.
    If you want something more automatic, it will requre efforts – look at introspection api. Basically, you call describeType on your class and it returns XML description. All variables will be listed there, along with other info. Then you can parse returned XML and set all variables to needed value, accessing them dynamically with square bracket syntax:

    var myClass:MyClass = new MyClass();
    myClass["varName"] = "new value";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of variables I want to display of which some are
I have a function that creates a bunch of local variables, then passes their
I'm writing a generic wrapper class for a bunch of classes we have defined
I have a bunch of business class with autoproperties : public class A {
I have a Python class that have attributes named: date1, date2, date3, etc. During
I have a class called Info , and i have a bunch of static
I have an entity class with a bunch of non-nullable string properties. If I
I have a large string in a variable that includes a whole bunch of
I am looking for a way to have a Matrix variable (i.e, a bunch
I have bunch of strings, some of which are fairly long, like so: movie.titles

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.