[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: re easylang. help



PureBytes Links

Trading Reference Links

On Tue, 28 May 2002, ed wrote:

> Hi
> 
> First thanks a million to Bob and Mike for very
> proffesional and informative reply's.
> 
> Bob I realy want to use easylang.  not basic, because this will be part 
> of the system, so it's better to use one language for all system parts.
> 
> I have used parts from both of your codes and came up with the following:
> 
> variables:n(0),x(0),y(0),z(0),str(""),goodnbr(true);
> if currentbar=1 then begin
>  FOR X = 1000000 TO 1555555 begin
>   goodnbr=true;
>   str=numtostr(x,0);
>   str=midstr(str,2,6);
               ^ if you're doing this, then why not for x = 0 to 555555 begin?
>   FOR Y = 1 TO 6 begin
                 ^ 5
>    if midstr(str, y, 1) > "5" then goodnbr=false;
    digit = midstr(str, y, 1);
>    FOR Z = Y + 1 TO 6 begin
>     IF midstr(str, Y, 1) = MIDstr(str, Z, 1) then goodnbr=false;
    if digit > "5" or digit = midstr(str, z, 1) then goodnbr = false;
>    end;
>   end;
>   if goodnbr then begin
>    N = N + 1;
>    print(numtostr(n,0),"-", str);
>   end;
>  end;
> end;
> 
> I need 6 digit number with unique digits from 0 to 5.
> 
> This code works partialy,  before going into infinite loop.

is it truely a loop or is it just in a portion of the number that has a six?
use the print you already have for good conditions and make another
print for unmatched conditions

when you have it working, remove the second print from the code