Announcement

Collapse
No announcement yet.

Is there any way to create dynamic numbered variables? int32 Variable[1-100] ??

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there any way to create dynamic numbered variables? int32 Variable[1-100] ??

    Is there any way to create a variable that's say

    int32 Variable[#];

    Then be able to create it via
    Variable[1] = 2;

    and call it via
    VariableTest = Variable[1];
    Result: VariableTest = 2


    ??????

  • #2
    This is exactly what arrays are for:

    eg.

    TArray<int32> Variable;

    Variable[0] = 2;

    int32 VariableTest = Variable[0];

    Result:
    VariableTest = 2;

    Comment


    • #3
      Is there any way to put the TArray inside a TSharedRef?

      TArray<int32> Variable;
      TSharedRef<Test> MyScrollBar[Variable] = Test;

      ???
      can't figure it out
      Last edited by NachoBiznezz; 09-23-2017, 02:47 PM.

      Comment


      • #4
        you are always asking weird stuff ja, no need, use decorator UPROPERTY() over your tarray, daddy unreal will manage this for you like a TSharedRef

        Comment


        • #5
          https://forums.unrealengine.com/deve...ide-tsharedref


          Still a way to do it apparently, never tried your response as I just realized this, though I might

          Comment

          Working...
          X