For-next question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all, this question seems simple but I need help. Basically I am trying to
create a schedule form based on data from a table

Here is a table with data

Table
Start End
36616.1 36616.3
36616.5 36616.6
36616.9 36617.4
36617.7 36618.2
36618.5 36618.7

I would like the above data to be represented similar to the form shown
below.

Form
0123456789

36616 XXX XX X
36617 XXXXX XXX
36618 XXX XXX

Any ideas? Thanx, Jim
 
On Fri, 25 Feb 2005 10:04:27 -0800, Jim Brown <Jim
Hi all, this question seems simple but I need help. Basically I am trying to
create a schedule form based on data from a table

Here is a table with data

Table
Start End
36616.1 36616.3
36616.5 36616.6
36616.9 36617.4
36617.7 36618.2
36618.5 36618.7

What's the datatype of Start and End? If it's Single or Double Float
you may have some contortions to go through, since floating point
numbers are not stored exactly but as approximations: extracting the
..1 may be tricky. If the 36616 is actually one field and the .1 or .2
a different field, then it would be preferable to store them in two
fields!
I would like the above data to be represented similar to the form shown
below.

Form
0123456789

36616 XXX XX X
36617 XXXXX XXX
36618 XXX XXX

Exactly what do you want? Ten checkboxes? A text string containing
blanks and the letter X?

John W. Vinson[MVP]
 
Because one record can span two printout lines (as in lines 3 and 4 of your
example) you can't print each line as you process each record. You will
need to create a set of data then print it when complete. The data will be
a set of values (index) and strings (result).

The pseudo-code would look like this.
for each record in table
for counter = record.Start to record.End step 0.1 'eg 36616.1 to 36616.3
Row = Int( counter ) 'eg 36616
if not exists( temp.Row )
temp.AddRecord( Index:Row, Result:" " ) 'that's ten
spaces
end if
ColumnValue = ( counter - RowValue ) * 10 'eg 1 for 36616.1
mid (temp.Row.Result, Column + 1, 1 ) = "X"
next counter
next record

Then print each element
for each record in temp
print Index, Result
next record
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top