At 08:07 2018-01-01, Ted Roche <[email protected]> wrote:
>
> On Mon, Jan 1, 2018 at 5:20 AM, AndyHC <[email protected]> wrote:
>> Just opened up a Command Window to list off 1/3 f stops -
>>  - why the curious indentation?
>>
>> CLEAR
>> SET DECIMALS TO 2
>> SET FIXED ON
>> x=1
>> mc=2^(1/6)
>> FOR i = 1 TO 30
>> x=x*mc
>> ?x
>> NEXT
>> ?

Ah! See it now. That *IS* weird. Looks like two additional spaces
indented in the first 8 numbers. Perhaps related to their length?

SET DECIMALS and SET FIXED are truly ancient xBase commands, and SET
commands in general -- either global in scope or scoped to a
datasession -- wreak all sorts of havoc with unintended side-effects.
It's a lot better to specify what you want in the actual command than
to depend on modifying the environment to suit program execution.

Try this:

FOR i = 1 TO 30
  ? ROUND((2^(1/6))^i,2)  && compressed algorithm
NEXT

Fixed and decimals and printing to the screen are all pretty
old-school, but you're running BASIC here, and not really FoxPro.

It appears to be a bug. VFP seems to be calculating the output length based on fixed being off, then printing the fixed on value in that length right-justified.

Sincerely,

Gene Wirchenko





--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com

[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/20109741a4d332175a5d5e54f629603c@mtlp000084
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to