Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Nov 19, 2017 9:14 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: statictext array building/ data cycling
PostPosted: Fri Oct 01, 2010 8:19 pm 
Offline

Joined: Mon Sep 27, 2010 3:43 pm
Posts: 7
Location: Bass Lake, near Orillia,Ontario, Canada
Hello all I am trying to create and place (9x9=81) statictext boxes in a Sudoko grid. .I looked at cloning and indexing etc and cannot control the naming and adjusting(enerting data) to the boxes. Cannot program the instructions to create a statitext array, and place in a grid for Sudoku, and populate with my generated digits.Help I want is create some elements of an array and play with them. In Basic and VB it all worked.
I really appreciate this forum and its help.
old George

_________________
ole George...


Top
 Profile  
Reply with quote  
 Post subject: Re: statictext array building/ data cycling
PostPosted: Fri Oct 01, 2010 10:48 pm 
Offline

Joined: Sat Nov 24, 2007 3:09 pm
Posts: 159
Location: Denver, CO
You would probably want an array of textFields, so make one textField in the IDE and set its index to 0 then in you code you would do something like this:

if your textField is called someField
for n as integer = 1 to 81
dim t as new someField
t.left = 50 //etc. etc. or you can now use someField(n).left etc.
next

Now, in the textField's events you will also get an index parameter so you can do things like someField(index).text or me(index).text and determine which field you're dealing with. As long as you set up your matrix logically, the rest of the logic should be pretty easy.

_________________
Mojiferous Industries, now 300% more Mojifertastic!


Top
 Profile  
Reply with quote  
 Post subject: Re: statictext array building/ data cycling
PostPosted: Sat Oct 02, 2010 9:48 am 
Offline

Joined: Mon Sep 27, 2010 3:43 pm
Posts: 7
Location: Bass Lake, near Orillia,Ontario, Canada
I thank you mo..will give it a shot.

_________________
ole George...


Top
 Profile  
Reply with quote  
 Post subject: Re: statictext array building/ data cycling
PostPosted: Sat Oct 02, 2010 3:15 pm 
Offline

Joined: Mon Sep 27, 2010 3:43 pm
Posts: 7
Location: Bass Lake, near Orillia,Ontario, Canada
Tried moj suggestion but can only iterations of 2 textfields, no matter what for next loop upper is.

_________________
ole George...


Top
 Profile  
Reply with quote  
 Post subject: Re: statictext array building/ data cycling
PostPosted: Mon Oct 04, 2010 4:43 pm 
Offline

Joined: Sat Nov 24, 2007 3:09 pm
Posts: 159
Location: Denver, CO
Try someField(n).left instead of t.left in the for loop... What does your code look like?

_________________
Mojiferous Industries, now 300% more Mojifertastic!


Top
 Profile  
Reply with quote  
 Post subject: Re: statictext array building/ data cycling
PostPosted: Mon Oct 04, 2010 6:57 pm 
Offline

Joined: Mon Sep 27, 2010 3:43 pm
Posts: 7
Location: Bass Lake, near Orillia,Ontario, Canada
fixed..sorta
I set up a array textfield and wrote the below.
now to arrange cycling thru generating random numbers that obey the rules of sudoku
was easy in vb...but now is horrible
also rb take 5 times as long to generate the grid..
thanks for yor hints..

dim i, x,y as integer
dim s(10) as textfield
for x = 1 to 9
for i = 1 to 9
s(i) = new tfa
s(i).left = x
s(i).left = me.left +20 +40*i
Dim r as New Random
s(i).text=Str(r.InRange(0,9))
next i
next x
y = me.top - me.height
for x = 1 to 9
for i = 1 to 9
s(i) = new tfa
s(i).left = x
s(i).top=125
s(i).left = me.left +20 +40*i
s(i).text = "2"
next i
next x
for x = 1 to 9
for i = 1 to 9
s(i) = new tfa
s(i).left = x
s(i).top=165
s(i).left = me.left +20 +40*i
s(i).text = "3"
next i
next x
for x = 1 to 9
for i = 1 to 9
s(i) = new tfa
s(i).left = x
s(i).top=205
s(i).left = me.left +20 +40*i
s(i).text = "4"
next i
next x
for x = 1 to 9
for i = 1 to 9
s(i) = new tfa
s(i).left = x
s(i).top=245
s(i).left = me.left +20 +40*i
s(i).text = "5"
next i
next x
for x = 1 to 9
for i = 1 to 9
s(i) = new tfa
s(i).left = x
s(i).top=285
s(i).left = me.left +20 +40*i
s(i).text = "6"
next i
next x
for x = 1 to 9
for i = 1 to 9
s(i) = new tfa
s(i).left = x
s(i).top=325
s(i).left = me.left +20 +40*i
s(i).text = "7"
next i
next x
for x = 1 to 9
for i = 1 to 9
s(i) = new tfa
s(i).left = x
s(i).top=365
s(i).left = me.left +20 +40*i
s(i).text = "8"
next i
next
for x = 1 to 9
for i = 1 to 9
s(i) = new tfa
s(i).left = x
s(i).top=405
s(i).left = me.left +20 +40*i
s(i).text = "9"
next i
// ERROR s(i).text=str(4)
next x

_________________
ole George...


Top
 Profile  
Reply with quote  
 Post subject: Re: statictext array building/ data cycling
PostPosted: Tue Oct 05, 2010 11:11 am 
Offline

Joined: Mon Sep 27, 2010 3:43 pm
Posts: 7
Location: Bass Lake, near Orillia,Ontario, Canada
to followers of this Sudoku program :
I have since double dimensioned the array cells.
next to gen random numbers and populate cells, while assuring no rules broken.
Then to randomly blank cells as to easy medium and hard catagories and store and print.
Then to all ow program to solve puzzles via cell inputs and it fills rest in....

Long road up!

_________________
ole George...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group