Jump to content
Tuts 4 You

Why not change field bool ?


r3xq1

Recommended Posts

Posted
foreach (FieldDef tdFlds in tdType.Fields)
{
    if (tdFlds.ElementType == ElementType.End)
    {
        if (tdFlds.Name == "MyField")
        {
            byte[] fake = BitConverter.GetBytes(true); // set true
            Array.Resize(ref fake, (int)tdFlds.GetFieldSize());
            tdFlds.InitialValue = fake;
        }
    }
}

How can the bool field be changed?

  • 2 weeks later...
Posted
byte[] fake = BitConverter.GetBytes(true) -- fine

Array.Resize(ref fake, (int)tdFlds.GetFieldSize()); --why to resize it ? possible here you destroy it 

 

  • 1 month later...
Posted
On 11/14/2021 at 11:32 PM, whoknows said:
byte[] fake = BitConverter.GetBytes(true) -- fine

Just this not work!

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...