Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Naming subclasses
Message
From
23/02/2004 08:48:56
 
 
To
23/02/2004 08:09:32
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00879787
Message ID:
00879868
Views:
18
Except that unfortunately, it's not a good example. Or, at least, if it is a good example, it's a good example of why prefixes may be a good thing rather than not.

The two pieces of code are not logically the same and might well lead the developer to see this as producing entirely different results. Even though it's just a view, and doesn't really do that.

Look at the 1st code line in each:
lnBufferSize = iif(pcount() = 1, MAX_BUFFER_SIZE, tnBufferSize) + 1
vs
BufferSize = iif(pcount() = 1, MAX_BUFFER_SIZE, BufferSize) + 1
This might sound like nit-picking, but without using prefixes, or being a whole lot more careful about what your varnames are, bugs may abound and may be difficult to find (as this code shows).

I wouldn't want to see code that might change my understanding of what the code is doing.

Alan

>Save the work on the IDE, Peter, and just code like your second example from the start < s >
>
>cheers
>
>
>>[snip]
>>>>Moreover, in that IDE you can switch between views. In one view you only see the descriptors, in another view you also see the technical details like datatype and scope. How about that. Shall we start writing that IDE?
>>>
>>>Not sure what you're trying to say and how valuable this would be.
>>
>>Imagine a button or hotkey that changes the display of the text, like:
>>
local lcLocalPath, lcBuffer, lnBufferSize, lnResult, lcStructureString
>>		
>>lnBufferSize = iif(pcount() = 1, MAX_BUFFER_SIZE, tnBufferSize) + 1
>>lcLocalPath  = lcDrive
>>lcBuffer     = space(lnBufferSize)
>>lnResult     = WNetGetConnection(@lcLocalPath, @lcBuffer, @lnBufferSize)
>>into:
BufferSize = iif(pcount() = 1, MAX_BUFFER_SIZE, BufferSize) + 1
>>LocalPath  = Drive
>>Buffer     = space(BufferSize)
>>Result     = WNetGetConnection(@LocalPath, @Buffer, @BufferSize)
Previous
Reply
Map
View

Click here to load this message in the networking platform