Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Botton Problem
Message
De
25/03/2003 13:17:01
 
 
À
25/03/2003 12:39:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00769801
Message ID:
00769824
Vues:
20
>OK..the deal is, like this.
>
>Im making a form were the user can add some pictures.
>
>For this I have a Memo field and I just can get the code right, I mean I have a botton were is says add pic. Here is were I want to put the code so the user can add the pic. Is this right??
>
>AND CAN ANYBODY TELL ME WHAT CODE IT HAS TO BE IN THE BOTTON ???
>
>
>
>Thanks Ya'll...
>
>Dont Hate NEWBIES


Alex:

Nobody here hates newbies. In fact we are very friendly and we even have a VFP Spanish section for you, if you prefer to ask in Spanish.

But there is no need to shout. That is bad netiquette. (UPPERCASE looks like shouting).

Now, to your questions.

There are some problems with your idea.

First of all, you should not use memo fields to store pictures. They tend to grow immensely. It is much better to have a subfolder where you store pictures directly as files (jpg, gif, etc).. All you need to do is have a simple text field in your table, that indicates the path and filename to link to each picture.

As for the code, you could ask the user to supply the file name, maybe using GetDir() to point to the file, then Copy File to copy or move it to your picture folder (destination).

Lastly, even though it works, reusability rules inOOP, say that generally you should not put code like this in a command button, but have the button call a method in the form or other generic object, to do the work. This way, you can have a button that asks for a file, and depending on the situation it could be a picture, a file to print, a text file, or whatever. The form should be the one to know in every case.

HTH


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform