Page 1 of 2
Webserver SetOutValueArray
Posted: Wed Feb 01, 2023 9:35 pm
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
Re: Webserver SetOutValueArray
Posted: Thu Feb 02, 2023 9:21 am
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.
Re: Webserver SetOutValueArray
Posted: Thu Feb 02, 2023 2:15 pm
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.
Re: Webserver SetOutValueArray
Posted: Thu Feb 02, 2023 2:41 pm
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 (10.56 KiB) Viewed 4630 times

- Snag_a765a3.png (13.72 KiB) Viewed 4630 times
Re: Webserver SetOutValueArray
Posted: Fri Feb 03, 2023 11:11 am
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

Re: Webserver SetOutValueArray
Posted: Sun Feb 05, 2023 11:51 pm
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>
Bob
Re: Webserver SetOutValueArray
Posted: Tue Feb 07, 2023 10:14 am
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 (6.69 KiB) Viewed 4515 times
Re: Webserver SetOutValueArray
Posted: Wed Feb 08, 2023 8:11 pm
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
Re: Webserver SetOutValueArray
Posted: Thu Feb 09, 2023 8:41 am
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
Re: Webserver SetOutValueArray
Posted: Thu Feb 09, 2023 12:01 pm
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.