Webserver SetOutValueArray

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
RGV250
Posts: 264
http://meble-kuchenne.info.pl
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Webserver SetOutValueArray

Post by RGV250 »

Hi,
I was wondering on the possibility of having arrays for the SetOut values. I have seen somewhere on the forum that it is possible to concatenate the strings to do something like this but that does seem messy and you need a lot of code at both ends to process it.
It looks like JavaScript has arrays so I think it should be possible, I wonder if it would then be possible to mix data types?

Regards,
Bob

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: Webserver SetOutValueArray

Post by BenR »

Hi Bob,

I like the idea, I wonder if we could add a new component to allow array to string and string to array. Maybe something like the explode and implode functions in PHP. I'll have a play and see if I can come up with something useful.

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: Webserver SetOutValueArray

Post by BenR »

Right I've made something which may or may not be useful for this.
https://www.flowcode.co.uk/wiki/index.p ... _(Utility)

I've pushed it to the v9 and v10 component library update systems.

Let me know if you think of any other functions you would like added.

stefan.erni
Valued Contributor
Posts: 758
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: Webserver SetOutValueArray

Post by stefan.erni »

Hi Ben

It' looks good. Just it's missing for the App Developer.

And the Auto Version Id would also be something for the app developer?

and something else I miss is command which can convert a byte, integer, float into a string with leading zeros or space.
This might also go into the Advanced String Function?

regards

Stefan
Snag_a77802.png
Snag_a77802.png (10.56 KiB) Viewed 1444 times
Snag_a765a3.png
Snag_a765a3.png (13.72 KiB) Viewed 1444 times

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: Webserver SetOutValueArray

Post by BenR »

Hello,

The component should be there for AD now. We are investigating adding the auto version component, it's a bit trickier but we have a plan on how to do it.

The formatted strings is a good idea. I'll have a think on how to add it.

edit - now added the formatted strings :D

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Webserver SetOutValueArray

Post by RGV250 »

Hi Ben,
I have been looking and it is way above my head, it might be what I am looking for but I have no idea. I have made a bit of a mock up to hopefully show how I envisage it. It may not be possible though at the web side.
I have mocked up what I think the Flowcode side would be and how I think it would be in the web side but unsure if it is possible.
<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Arrays</h2>

<p id="Integer"></p>

<p id="Float"></p>

<script>
//Not sure if I need the const here
const TestArrayInt = [%0]; // Should populate it with this [40, 100, 1, 5, 0, 0]
document.getElementById("Integer").innerHTML = TestArrayInt[0];

//Not sure if I need the const here
const TestArrayFloat = [%1]; // Should poulate it with [10.40, 100.23, 1.5, 5.7, 0.0, 0.0]
document.getElementById("Float").innerHTML = TestArrayFloat[0];
</script>

</body>
</html>
WebArrayIdea.fcfx
(13.84 KiB) Downloaded 44 times
Bob

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: Webserver SetOutValueArray

Post by BenR »

Hi Bob,

This should do what you're after. Make sure you do a full database library update to get the Advanced string component.
ArrayToString.jpg
ArrayToString.jpg (6.69 KiB) Viewed 1329 times
WebArrayIdea.fcfx
(17.24 KiB) Downloaded 47 times

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Webserver SetOutValueArray

Post by RGV250 »

Hi Ben,
A big thanks for that, I can understand what i going on where i did not have a clue with the other example.
I will have to wait until the weekend to try it on my laptop which has the external web browser example. For some reason I am still having an issue with simulating that on Win 7 an the https problem. Probably need to change the IP address.

Bob

RGV250
Posts: 264
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 23 times
Been thanked: 30 times

Re: Webserver SetOutValueArray

Post by RGV250 »

Hi Ben,
This is probably for another post but as I did mention it in post one I thought I would mention it to see what your thought is. I have not been able to try this with external web pages yet but it does look ideal for what I asked for.
I think what you have created is ideal for what I asked for/needed, the icing on the cake would be it if would be possible to mix variables IE int/float/strings.
I think this would actually require a new variable / array to allow mixed data types. If you think this is possible and more important if others would think it is needed let me know and I will start a seperate request for it. With what you have done I can get around it but think this will make it even better.

Bob

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: Webserver SetOutValueArray

Post by BenR »

Hi Bob,

I think what you're asking for there is a struct, we have discussed adding structs a few times but currenty they are not natively supported by Flowcode. They are however supported by the underlying C compilers. I'll have a think on if we can do something here.

Post Reply