Android Question json-string question

FrankDev

Active Member
Licensed User
Longtime User
Hello

I have an array with dummy data.

B4X:
Participants: [{pseudonym=Jakob Dierks, gender=m, age=18, group=1}, {pseudonym=Alexander Rist, gender=m, age=18, group=1}, {pseudonym=Jan Schunk, gender=m, age=18, group=1}, {pseudonym=Emil Reineke, gender=m, age=20, group=1}, {pseudonym=Louis Holm, gender=m, age=20, group=1}, {pseudonym=Louis Dröge, gender=m, age=20, group=1}, {pseudonym=Lukas Graupner, gender=m, age=20, group=1}, {pseudonym=Thomas Angerer, gender=m, age=21, group=1}, {pseudonym=Oliver Kuntz, gender=m, age=21, group=1}, {pseudonym=Jasper Kappes, gender=m, age=21, group=1}, {pseudonym=Elias Bensch, gender=m, age=22, group=1}, {pseudonym=Markus Siegl, gender=m, age=22, group=1}, {pseudonym=Alexander Christian, gender=m, age=22, group=1}, {pseudonym=Lena Tetzlaff, gender=w, age=18, group=1}, {pseudonym=Amelie Bechtold, gender=w, age=18, group=1}, {pseudonym=Emma Kuntz, gender=w, age=18, group=1}, {pseudonym=Isabella Wiemer, gender=w, age=19, group=1}, {pseudonym=Johanna Voit, gender=w, age=19, group=1}, {pseudonym=Nane Stehr, gender=w, age=22, group=1}, {pseudonym=Isabella Ertel, gender=w, age=22, group=1}, {pseudonym=Leonie Dröge, gender=w, age=23, group=1}, {pseudonym=Ava Bechtold, gender=w, age=23, group=1}, {pseudonym=Nele Hinrichsen, gender=w, age=24, group=1}]

I can determine the number of 'records',
or all the participants that are

'gender=m' ?

so of course i don't want to loop through the array

Greetings
Frank
 
Last edited:

drgottjr

Expert
Licensed User
Longtime User
either you're treating your data as a json string (in which case you have to loop
through it), or you're treating the data as a simple text string (in which case, you
you would use regex to match certain parts. but this also involves a loop).

exactly what is it you're trying to do?

you say you already can determine the number of "records" or all the participants
that are 'gender=m'.

if you can already do this, what is that you want to do?
 
Upvote 0

FrankDev

Active Member
Licensed User
Longtime User
as I see the whole thing as a 'string', thought there was a command,
that does something like

number = command(jsonstring, "gender=w")

well... i solved it as a loop now ;)

thanks for the feedback !
 
Upvote 0
Top