Board index » delphi » Help needed on Pascal programming

Help needed on Pascal programming

Hi, I am currently learning to write a program which will enable me to
input some stocks item and then I would like to be able to do some
searching and lastly printout, would be much grateful if you can help
me with the programming, My requirement is as follows -

1. write the code for a file containing 3 fields as follows-

          StockNum              Description             Quantity
           XXXXXX                XXXXXXXXXXX                      XX

2 . when user enter the program, they have to key in StockNum (Integer
- 5 digits)

3. then the pointer will gotoxy(X,X) under Description for the
decription (String - 15 char)

4. and then the pointer will gotoxy(X,X) under Quantity for input
(Integer - 3 digits)

5. after that the pointer will go down next line for second record

Pls note - the 3 fields will be on the same line

thank you for any pointers and guidance.

 

Re:Help needed on Pascal programming


Hi, I am currently learning to write a program which will enable me to
input some stocks item and then I would like to be able to do some
searching and lastly printout, would be much grateful if you can help
me with the programming, My requirement is as follows -

1. write the code for a file containing 3 fields as follows-

          StockNum              Description             Quantity
           XXXXXX                XXXXXXXXXXX                      XX

2 . when user enter the program, they have to key in StockNum (Integer
- 5 digits)

3. then the pointer will gotoxy(X,X) under Description for the
decription (String - 15 char)

4. and then the pointer will gotoxy(X,X) under Quantity for input
(Integer - 3 digits)

5. after that the pointer will go down next line for second record

Pls note - the 3 fields will be on the same line

thank you for any pointers and guidance.

Re:Help needed on Pascal programming


Quote
> Hi, I am currently learning to write a program which will enable me to
> input some stocks item and then I would like to be able to do some
> searching and lastly printout, would be much grateful if you can help
> me with the programming, My requirement is as follows -

   It's pretty clear that this is a school assignment, and as such you're
not likely to get the (whole_ program written for you - you should do the
work yourself, no?

Quote
> 1. write the code for a file containing 3 fields as follows-
>           StockNum                 Description             Quantity
>            XXXXXX                XXXXXXXXXXX            XX

   Just reading 3 variables, right?

Quote
> 2 . when user enter the program, they have to key in StockNum (Integer
> - 5 digits)

   Looks as though you're expecting 6 digits above...

Quote

> 3. then the pointer will gotoxy(X,X) under Description for the
> decription (String - 15 char)

> 4. and then the pointer will gotoxy(X,X) under Quantity for input
> (Integer - 3 digits)

> 5. after that the pointer will go down next line for second record

   Merely a matter of a series of 3 GoToXY (column,row); Readln
(data_var) statements - is that such a big deal?

Quote
> Pls note - the 3 fields will be on the same line

   Sure...and I've provided as much as you need to know (to do it
yourself).

Re:Help needed on Pascal programming


Quote
Mike Copeland wrote:
>    Merely a matter of a series of 3 GoToXY (column,row);

Actually, it's easier to write something like:WriteLn( X.a:10, X.b:20,
X.c:20);

Mariano.

Re:Help needed on Pascal programming


Quote
> >    Merely a matter of a series of 3 GoToXY (column,row);

> Actually, it's easier to write something like:WriteLn( X.a:10, X.b:20,
> X.c:20);

   I don't think that's what he needed.  As I understood (?) the problem,
he wanted to prompt for the individual input fields (3 of them) by moving
the input cursor to beneath the field header.  Therefore, it seems he
needed to gotoXY, write, readln at each of the locations for the fields.  
I could be wrong, though, because the original post was pretty muddled
and ambiguous...8<{{

Re:Help needed on Pascal programming


Quote
>    I don't think that's what he needed.  As I understood (?) the problem,
> he wanted to prompt for the individual input fields (3 of them) by moving
> the input cursor to beneath the field header.  Therefore, it seems he
> needed to gotoXY, write, readln at each of the locations for the fields.

Yep, you're right - sorry. My mistake.

Quote
> ...though, because the original post was pretty muddled
> and ambiguous...8<{{

  Right again! ;o)

Mariano.

Other Threads