Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running a text file directly from a menu
Message
De
29/07/2004 11:56:01
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
29/07/2004 05:11:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00926569
Message ID:
00929253
Vues:
26
>Hilmar,
>
>It finally works perfect. This is the code below that's got it working.
>Thanks again for your help.
>
>DO while(AsbDoc.ad_menu='D')
>DEFINE BAR i of keydoc PROMPT (Allt(AsbDoc.ad_label))
>cRun = “SHELLEXEC(‘“+Allt(AsbDoc.ad_file)+”’)”
>ON SELECTION BAR i of keydoc &cRun
>i=i+1
>Skip
>ENDDO

OK. BTW, a loop that processes records is usually simpler with SCAN than with DO.

Adapting your example:
SCAN while(AsbDoc.ad_menu='D')
  DEFINE BAR i of keydoc PROMPT (Allt(AsbDoc.ad_label))
  cRun = “SHELLEXEC(‘“+Allt(AsbDoc.ad_file)+”’)”
  ON SELECTION BAR i of keydoc &cRun
  i=i+1
ENDSCAN
Here, only the SKIP was omitted. In some cases, you save more. For instance, a loop that processes all records, with DO WHILE:
go top
do while not eof()
  (do something)
  skip
enddo
And with SCAN:
scan
  (do something)
endscan
Also, to process all records that fulfill a certain condition, you can:
SCAN FOR (condition)
   ...
ENDSCAN
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