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)