Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running Code Dynamically
Message
De
04/08/1997 08:51:42
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, États-Unis
 
 
À
04/08/1997 08:28:22
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00041271
Message ID:
00043033
Vues:
33
>> Has anyone tried to generate a PRG and run it dynamically at run-time. I
>> have a table with a memo field with the code I want to execute at run-time.
>> This works under development mode but fails at run-time, since the PRGs I
>> dynamically create are not "burned" in the EXE.
>>
>> Any ideas?
>>
>> TIA
>>
>> Antonio Lozada
>
>I do it all the time, but not from the .exe, nor from the .app. (See
>RebFpt.zip here in Files section, it does just that). In .exe (and maybe
>in .app too) you don't have the full VFP, so you don't have the
>compiler. There are utilities, though, to achieve that. Maybe the trick
>of running what's on the clipboard (run selected lines, as appears when
>you select couple of lines on the Command window and right-click it) may
>be used here?
>
>The generate-compile-run-on-the-fly routines are intended to save you
>coding time, and not to keep happening at the user's machine all the
>time. Besides, what do you need that for? I know, this is exactly the
>question I don't like, but couldn't resist it - that's what a Clipper
>programmer asked me when I asked him if Clipper was capable of writing,
>compiling and immediately running a .prg :)
>
>P.S. I appologize to all who had to download my messages several times -
>I've had hardware troubles (sold my modem and now try three modems in a
>row for some ten days, none of them working), so I tried to send them
>from the office, by simply carrying the outbox. file, and inside it
>there was some FCC line, pointing to a wrong path. Netscape mailer kept
>informing me of errors, so I thought the messages didn't get sent, so I
>sent them again couple of times... and afterwards it dawned on me it was
>only looking for a wrong Sent. file ;(.
>
>I'll get around next time. I'll have to do it (send from office) for
>some time now, since the latest modem permanently reports "port is in
>use by another program" and simply doesn't dial, so I'd better do it
>right.

What about macro substitution? Assuming each line in the memo field was a complete command (no ';'), then you can read each line in the memo field, set it equal to x and then &x. Presto! No compilation necessary. I find it particularly useful to send messages to certain users in an app, or have certain users automatically fire specific commands at startup.

HTH

Matt
Matt McDonnell
...building a better mousetrap with moldy cheese...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform