Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coding
Message
De
26/08/2008 08:21:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
26/08/2008 08:03:36
Muthu Vel
Sty Company
Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Coding
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01341734
Message ID:
01341740
Vues:
20
>I have create Bus Reservation.dbf, its having five fields namely 1.name 2.date of reservation 3.class 4.No of tickets 5. Bus No.
>
>No of tickets for a date for First class = 30
>
>No of tickets for a date for 2nd class = 50
>
>I want to wite a source code for a Bus reservation in such away, everyday the Accomodation opens with a fixed number of tickets
>(above I have mentioned) that has to be repeated every day so that the process will be repeated infinitely. i e on all day.
>
>How to write code?

If I understand correctly, you want to create the 80 records for the reservations.

You can write a loop, and use either INSERT INTO or APPEND BLANK to add the records. For example:
* First class
local i
for i = 1 to 30
  append blank
  replace;
    date with date(),;
    class with 1,;
    ...
next
* Similar for second class
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform