N1c0_ds
05-05-2007, 06:27 PM
Hello again! I didn't want to hijack my previous thread so here's my new HB++ question:
I have a list of strings (over 400 different strings) that I want to access randomly.
My current config is the following:
Public Sub Generate()
Randomize
Dim n As Integer
n=(20 - 0 + 1) * Rnd() + 0
If n=0 Then Field1.Text = "..."
If n=1 Then Field1.Text = "..."
If n=2 Then Field1.Text = "..."
If n=3 Then Field1.Text = "..."
If n=4 Then Field1.Text = "..."
If n=5 Then Field1.Text = "..."
If n=6 Then Field1.Text = "..."
If n=7 Then Field1.Text = "..."
If n=8 Then Field1.Text = "..."
If n=9 Then Field1.Text = "..."
If n=10 Then Field1.Text = "..."
If n=11 Then Field1.Text = "..."
If n=12 Then Field1.Text = "..."
If n=13 Then Field1.Text = "..."
If n=14 Then Field1.Text = "..."
If n=15 Then Field1.Text = "..."
If n=16 Then Field1.Text = "..."
If n=17 Then Field1.Text = "..."
If n=18 Then Field1.Text = "..."
If n=19 Then Field1.Text = "..."
If n=20 Then Field1.Text = "..."
If n=21 Then Field1.Text = "..."
If n=22 Then Field1.Text = "..."
If n=23 Then Field1.Text = "..."
If n=24 Then Field1.Text = "..."
If n=25 Then Field1.Text = "..."
If n=26 Then Field1.Text = "..."
If n=27 Then Field1.Text = "..."
If n=28 Then Field1.Text = "..."
If n=29 Then Field1.Text = "..."
But since I have well over 400 of those "...", I get error 4008, and I need 'to put these strings in a database and access them dynamically at runtime' according to the manual.
Here's my question: How do I, with HB 1.04, put these strings in a database (external if possible) and access them randomly considering the StringList function is not available in this version?
Please answer quickly, thanks in advance!
Nico
I have a list of strings (over 400 different strings) that I want to access randomly.
My current config is the following:
Public Sub Generate()
Randomize
Dim n As Integer
n=(20 - 0 + 1) * Rnd() + 0
If n=0 Then Field1.Text = "..."
If n=1 Then Field1.Text = "..."
If n=2 Then Field1.Text = "..."
If n=3 Then Field1.Text = "..."
If n=4 Then Field1.Text = "..."
If n=5 Then Field1.Text = "..."
If n=6 Then Field1.Text = "..."
If n=7 Then Field1.Text = "..."
If n=8 Then Field1.Text = "..."
If n=9 Then Field1.Text = "..."
If n=10 Then Field1.Text = "..."
If n=11 Then Field1.Text = "..."
If n=12 Then Field1.Text = "..."
If n=13 Then Field1.Text = "..."
If n=14 Then Field1.Text = "..."
If n=15 Then Field1.Text = "..."
If n=16 Then Field1.Text = "..."
If n=17 Then Field1.Text = "..."
If n=18 Then Field1.Text = "..."
If n=19 Then Field1.Text = "..."
If n=20 Then Field1.Text = "..."
If n=21 Then Field1.Text = "..."
If n=22 Then Field1.Text = "..."
If n=23 Then Field1.Text = "..."
If n=24 Then Field1.Text = "..."
If n=25 Then Field1.Text = "..."
If n=26 Then Field1.Text = "..."
If n=27 Then Field1.Text = "..."
If n=28 Then Field1.Text = "..."
If n=29 Then Field1.Text = "..."
But since I have well over 400 of those "...", I get error 4008, and I need 'to put these strings in a database and access them dynamically at runtime' according to the manual.
Here's my question: How do I, with HB 1.04, put these strings in a database (external if possible) and access them randomly considering the StringList function is not available in this version?
Please answer quickly, thanks in advance!
Nico