Using "get current line number" for array position?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I've been working on this project for a little while now and I'm worried I might need to rewrite a whole lot of my code to work with arrays.

    Basically what I'm trying to do is this: I have a log menu that I can record numbers and notes to in my app. It starts out with a default of three pages but extra pages can be added at any time. When you click on an area of the log it'll give you an edit box to work in and a "okay" button to save what you've input and that's where the array comes in. I'm tracking the pages of my log book using a list object and whatever page is currently selected in the list object is the page that is displayed. I want the information that is typed into the edit box to be saved in an XY array that corresponds to the current selected line in my list object.

    What I thought would work is this:

    (For a value)
    When user clicks on button
    >Set Alterable Value A to Val(Edittext$("editbox"))
    >Write Value Alterable Value A("editbox") to (1, List Select("list"))

    I have a counter set to always display what's being stored in the array at 1,1 (since both the list object and the array object are set 1-based index) but it seems that nothing is being written there. The only thing I can think that would be messing it up is the "list select("list")" expression. I have another counter set up that uses that same expression to display the current line number so I know the expression works.. it just won't work in my array for some reason.

    Anyone have any idea where I'm going wrong here?

  • A simple error that often occurs:
    have you checked that you are using a "number array"?
    It won't write a val() if set to "text array".

    But I'm not exactly sure if I got what you're doing so I may be mis-targeting my answer >:)

    a selection of my Fusion examples can be found Please login to see this link.

  • You can store values if you convert to/from a string when writing/reading. In the expression editor, use Str$( value ) when writing to- and Val ( array index) when reading from the array. If you're only going to use numbers I guess a numerical array would be better since they're faster.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!