Populating a list or listbox at design time?

New releases and general discussions.

Post » Fri Jan 01, 2010 12:06 am

Hi all.

I have a database of text with over 2000 entries (and soon to be many more) that I want to populate a list or listbox with at design time, rather than have them loaded at runtime.

I've looked at both the list and listbox, but as far as I can see, there's no way of pasting any information into it.

I may have to create a binary file with all this info in it, and read what I want when I want it, but I'd rather go with using a list or listbox (but I'm not going to enter each piece of text by hand!)

So, is it possible to paste a clipboard into one of the lists at design time?
If not, consider this a feature request?

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sat Jan 02, 2010 12:07 am

Well, the deafening silence suggests my fears are founded. :)

It looks like I'll have to go down the binary file route.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sat Jan 02, 2010 12:12 am

Well, the deafening silence suggests my fears are founded. :)

It looks like I'll have to go down the binary file route.

BTW, why is the forum so slow these days?
Gone from a fraction of a second to display a page to 30-60 seconds.
This is the only website that I have this problem with.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sat Jan 02, 2010 12:38 am

If you are adding more than a handful of initial items - especially as many as 2000 - I'd recommend an external file anyway. I doubt it'd be convenient to have that many items in the editor.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat Jan 02, 2010 2:16 pm

Yeah, I'll find another way of doing it, although a couple of thousand entries in a dropbox or list isn't that many in memory terms.
And it's not for the end user to select from anyway.
It was just a way of keeping the list internal to the game.

I've a few things in mind.

P.S. Again, the forum seems to be dying, speed-wise, and that double post must be down to it too because I was editing the post, not posting a new one. :?

Krush
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sat Jan 02, 2010 4:12 pm

I've contacted the host about the forum slowness, hopefully they'll sort it out soon.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat Jan 02, 2010 6:27 pm

[quote="KrushBrother":h3676e3d]Yeah, I'll find another way of doing it, although a couple of thousand entries in a dropbox or list isn't that many in memory terms.
And it's not for the end user to select from anyway.
It was just a way of keeping the list internal to the game.[/quote:h3676e3d]

You could always populate your list from a text object. You could even use instances with PVs if you have multiple lists. I used text objects with INI info in them to load levels in Vert, in order avoid having a pile of .lvl files hanging around. They're just all tucked away on a hidden and locked layer.

I'm sure you could do something similar to keep from having external text lists.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Jan 02, 2010 7:42 pm

On my initial search of the forums when I started this thread, I came across your "text" object method in another thread where you were explaining it to someone else, but I haven't got around to looking at it yet.

Each line of data is on a separate line in the text file, and hence in a text object, like so:

fdsiksadflkhj
sfgpdisdfj
sdpusdpg9su
wrt90gjigfdklj
sdgf0gsdjipjgfd
rtew9u
dspjdfgpiuvc-u

Is there a way of reading the text.text contents line by line to populate a listbox?
I didn't think a text object could be manipulated this way.

I'm not sure if transferring the text contents to the Text Manipulator would enable me to read it line by line either, but from what I can remember it doesn't.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Sat Jan 02, 2010 8:17 pm

You can populate a list box at runtime from an external txt file.

+Start Of Layout
>Listbox Load From File

Or have I misread what your after achieving.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Sat Jan 02, 2010 8:41 pm

[quote="Minor":1dahll82]Or have I misread what your after achieving.[/quote:1dahll82]
I'm afraid you have.

I'm trying to hold thousands of pieces of data internal to the app.
So, placing them into a list at design time.

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests