Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detect state of memofield and textbox
Message
De
16/11/2012 11:18:11
 
 
À
16/11/2012 11:07:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01557010
Message ID:
01557455
Vues:
52
>>I think the point Koen is trying to make is that:
>> Yes, it's acceptable as far as VFP is concerned
>> BUT It is not a "good programming practice"
>
>What is not a "good programming practice" ?
>
>
>Having a file with a name m.txt ?

I notice that you still are in the argumentative mood. I am not, but a silly remark may require a silly answer, as we say where I come from.

Take this scenario: You have a variable called txt, and a file called m.txt. Now how can you know 110% for sure what happens if you refer to m.txt? Will VFP use the file or the variable?

NB! I realize that VFP will be able to make the distinction, but it won't necessarily be the one you expect, and that, my friend, is the main point in this discussion. I have spent days analyzing other people's code which didn't work as expected, quite a few of them were caused by wrong assumptions like we see here.

>>And I quote
>>>>Karen,
>>>>let it be clear, you CAN use a file m.txt in this case but you are highly recommended NOT to use it. Afterall what is in it to write
>>>>mText.txt = strofile(myfile)
>>>>instead of
>>>>m.txt = strofile(myfile)
>>>>
>>>>a few keystrokes more and you are assured of always perfect working coding. Besides mText.txt reads more clearly than m.txt to me, but that's highly personal.
>>>>
>>>>P.S. Is your problem meanwhile solved?
>>>>Regards,
>>>>
>>>>Koen
>>
>>(Italics added by me)
>>
>>Which part of that answer is not clear?
>>
>>It seems that he's trying to instill some 'best practices' ideas into a new programmer's head. Catch 'em young, Train 'em right.
>>
>>
>>>Koen,
>>>
>>>Field name or table name m or local variable name m - this is asking for trouble.
>>>
>>>File name 'm.txt' is absolutely OK and 0 trouble.
>>>
>>>
>>>>>Karen,
>>>>>
>>>>>There's nothing wrong having a file with the name m.txt
>>>>>
>>>>>(1) We're not talking about variables, and
>>>>>(2) Even if we were, there wouldn't be any problem either
>>>>>
>>>>>
>>>>>Don't let them confuse you
>>>>>
>>>>>_________________
>>>>>
>>>>
>>>>Gregory,
>>>>-I see I have started a discussion about the use of mDot, many replies and answers from Tore and Rick.
>>>>I was mainly trying to warn Karen. WIth your above remark you are confusing a 'newbie'
>>>>Technicaly speaking you may be correct in a statement: There is nothing wrong with a file name m.txt
>>>>But it is highly recommend not to use this like that. You are asking for troubles by neglecting a well acknowledged system.
>>>>
>>>>There is nothing wrong in using the mDot notification on the contrary there are only pro's
>>>>
>>>>But it is wrong to say that it is wrong not to use mDot notification
>>>>
>>>>
>>>>Karen,
>>>>let it be clear, you CAN use a file m.txt in this case but you are highly recommended NOT to use it. Afterall what is in it to write
>>>>mText.txt = strofile(myfile)
>>>>instead of
>>>>m.txt = strofile(myfile)
>>>>
>>>>a few keystrokes more and you are assured of always perfect working coding. Besides mText.txt reads more clearly than m.txt to me, but that's highly personal.
>>>>
>>>>P.S. Is your problem meanwhile solved?
>>>>Regards,
>>>>
>>>>Koen
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform