Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect state of memofield and textbox
Message
From
15/11/2012 15:33:25
 
 
To
15/11/2012 15:29:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01557010
Message ID:
01557338
Views:
44
me again - those programs i found that use M for variable are old obsolete programs that's why there were no errors.

>thanks tore - could be why i've gotten away with this so far (hierarchy) - certainly no single letter fields. After i read your note, I went through it all again and yes there are a couple of instances in which i use M as a variable - ouch - those i will change right away. Odd that i did not get error messages on those programs. btw i often use 'count to n for' i assume i am on safe ground there albeit still not a good practice.
>
>k
>
>>Karen,
>>
>>clearly there is some misunderstanding here. The thing is that m is a reserved word, since you can use it to tell that what comes after it plus a dot is variable, even though a field may have the same name. Like if you have opened a table with a field called XX with a value of 5, and a variable called XX with a value of 10. Now you see the following:
>>?5*XX && 25 since a field has precedence
>>?5*m.XX && 50 since m. tells VFP to use the variable XX.
>>Also note that m alone is not allowed as a variable name, and it's also not allowed as an alias. And a field named m would most likely be asking for real trouble,
>>
>>>Well this sounds ominous.
>>>i see what you're saying Koen and by all accounts what i am doing is declaring txt a vairable.
>>>
>>>on the upside so far i have not had any problems with it - opening, creating or saving - and that's going back 15 years.
>>>i don't have many occurrences of the coding that calls on what you describe - and those seem to work without issue as well.
>>>
>>>On the downside - i just checked and i have 2165 occurences of m.txt in my programs. i could change them enmass with the find and replace program i am using - it would take 2 minutes - but i am leaning towards if it ain't broke don't fix it. sometimes those enmass changes create some unexpected experiences.
>>>
>>>I am wondering what vfp is actually interpreting in m.txt to overlook this blunder.
>>>set alte to m.txt ----- could it be storing txt as a variable each time then overiding this with what I am actually intending, or could it be following the initial logic in the 'set alte to' and not making the variable connection at all.
>>>
>>>Now you have me worried!!!
>>>
>>>k
>>>
>>>
>>>>>thanks koen - yes the single letter variables i have had bad experiences with and M is the only that remains since it is always connected with the txt for my programs - i would have liked that information when i started this whole thing it would have saved me a lot time consuming changes.
>>>>>
>>>>>the debugger i will try - never used it - your instructions look pretty clear. thanks for that.
>>>>>
>>>>
>>>>Karen,
>>>>
>>>>the use of the one letter m as a variable name is an absolute shopstopper.
>>>>m. in vfp is a variable declaration (or whatever the correct word is) in anyway it 'tells' vfp that the word after a m and a fullstop is a variable and nothing else
>>>>so m.field is a variable field and not the field in a table.
>>>>
>>>>Take care and change your habit to make use of m as a variable, if you dontwant to change your coding than at least write m.m :)
>>>>
>>>>P.S. Thor has a nice function to change all the variables in your prg or methods to include the m. (M dot)
>>>>
>>>>Regards,
>>>>
>>>>Koen
>>tells
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform