Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Beautify bug - and syntax coloring?
Message
De
24/02/2006 17:01:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/02/2006 13:44:53
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01098909
Message ID:
01099072
Vues:
23
>>>
>>>Local ix,c
>>>Local Array aTest[1]
>>>For ix=1 To 3
>>>	Dimension aTest[ Iif(Type('aTest[1]')='C',Alen(aTest)+1,1) ]
>>>	aTest[ALEN(aTest)] = Transform(m.ix)
>>>Endfor
>>>Display Memory Like aTest
>>>
>>>Keywords:Mixed, Symbols:Match first occurence
>>>Beautify and bummer:(
>>>PS: Not looking for a workaround, I already have. Looks like a bug to me.
>>>Cetin
>>
>>I take my word back about workaround. Now I have a question:)
>>Does anyone know a way to protect "part of code" from beautify? Something like #NOBEATUTIFY. TIA.
>
>Hi Cetin,
>
>So, the problem is that it changes the 'C' in the Dimension statement to the Local c, causing the array to be dimensioned incorrectly.
>
>Have you considered not using "c" as a local variable? You could consider it like a reserved word, along with L, O, N, etc. I find Hungarian prefixes solve lots of problems with keywords!
>
>As an interesting side issue, I back-highlight strings. It makes it easy to know that you've matched " with " and not " with '. Since Fox considers [ and ] as string delimiters, I don't usually use them for arrays; I use parentheses.
>
>What I get for the Dimension line is Dimension aTest[ Iif(Type('aTest[1]')='c',Alen(aTest)+1,1) ], where the red is my back-highlight.
>
>What appears to happen (as I type) is that the parser ignores the second open bracket and ends the string with the first close bracket. Then it parses from the second quote to the third quote as another string. Finally the last end bracket is left dangling. The parser doesn't see it as closing the first open bracket.
>
>I'd call this a bug also, but I'm sure the Fox team wouldn't prioritize it very highly!

Hi Cindy,
How are you doing:)
Actually I never use single letter variables and there were no variables in the long routine where this happened originally. I just put that local c to reproduce in even 2 lines.
I don't care about syntax coloring part (and what I do is similar to yours - strings are black on yellow).
Original code were long and all I did was to add a new line ( I thought - but the culprit was I also pressed alt+TY and enter). Then suddenly code that work wonderfully for years started to break. As you might guess, I simply overlooked to check the lines that I trusted that'd work w/o a flaw. Needless to say after almost an hour of frustration I hardly noticed the lowercase 'c' there.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform