RE: Using squences with a for lop

new topic     » topic index » view thread      » older message » newer message

Thank you everybody.  I Figured out that the sequence had to be 
initalized, but I didn't know how to do it, cause data[1}="" sure don't 
work.  Now I use the repeat command to initalize it and it's working 
great!



Greg Haberek wrote:
> 
> 
> stupd Ctrl+Enter!! I was fumbling around my keyboard and accidently sent 
> the
> last post too early!
> here's what's left:
> 
> 
> sequence Lbl, Data
>     Lbl = {}    -- initialize with empty value
>     Data = {}
> 
>     Lbl = resizeSeq( Lbl, 2, 0 )    -- same as Lbl &= repeat(0, 2) or Lbl &=
> {0,0}
> 
>     Lbl[1] = create(LText,"Code",Win,20,50,60,20,0),
>     Data[1] = create(EditText,"",Win,100,50,42,20,ES_UPPERCASE),
> 
>     Lbl[2] = create(LText,"Description",Win,20,80,60,20,0),
>     Data[2] = create(EditText,"",Win,100,80,278,20,ES_UPPERCASE)
> 
> -- an easier way to do the above, however, is just using &=
> 
> sequence Lbl, Data
>     Lbl = {}
>     Data = {}
> 
>     Lbl &= create(LText,"Code",Win,20,50,60,20,0),
>     Data &= create(EditText,"",Win,100,50,42,20,ES_UPPERCASE),
> 
>     Lbl &= create(LText,"Description",Win,20,80,60,20,0),
>     Data &= create(EditText,"",Win,100,80,278,20,ES_UPPERCASE)
> 
> 
> ----- Original Message -----
> From: "Ron Austin" <ronaustin at alltel.net>
> To: <EUforum at topica.com>
> Sent: Saturday, October 25, 2003 9:43 AM
> Subject: Using squences with a for lop
> 
> 
> > I have made a simple program which stores a couple of fields
> >
> > - snip
> > constant
> > Lbl1 = create(LText,"Code",Win,20,50,60,20,0),
> > Code = create(EditText,"",Win,100,50,42,20,ES_UPPERCASE),
> >
> > Lbl2 = create(LText,"Description",Win,20,80,60,20,0),
> > Desc = create(EditText,"",Win,100,80,278,20,ES_UPPERCASE),
> >
> > --snip
> >
> >          err = db_select_table("Diagnosis")
> > err = db_insert(getText(Code),Diag_Data)
> > --snip
> >
> > Which is working okay with a couple of fields, but what if I want to
> > store 10, or 100?
> >
> > I know the answer is to use sequences and a for loop.  I can get data
> > out of a sequence using [], but how do you get it in?
> >
> > I tried this and that didn't work
> >
> > sequence
> >
> > Lbl1 = create(LText,"Code",Win,20,50,60,20,0),
> > data[1] = create(EditText,"",Win,100,50,42,20,ES_UPPERCASE),
> >
> > Lbl2 = create(LText,"Description",Win,20,80,60,20,0),
> > data[2] = create(EditText,"",Win,100,80,278,20,ES_UPPERCASE)
> >
> > I've read the manual and looked at programs, but I can't figure this
> > out.  I need to get this program running and  I'm stuck.
> >
> >
> > TOPICA - Start your own email discussion group. FREE!
> >
> >

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu