Jump to content

Vandrovnik

Members
  • Content Count

    523
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by Vandrovnik


  1. If you have SynEdit from GetIt, then yes, you may get newer version of SynEdit after installing newer Delphi.

    SynHighlighterMulti.pas is on C:\Users\MyUserName\Documents\Embarcadero\Studio\22.0\CatalogRepository\SynEdit-2022.03-11\Source\Highlighters\SynHighlighterMulti.pas on my computer in Delphi 11.1.


  2. 26 minutes ago, Lainkes said:

    Thanks for your answer.

    I'm struggeling with 

    
    RozdelLdap

    What is that function? Delphi does not recognise it.

    It was my function. It takes a string in the form "cn=Valek,ou=OOOO,o=XXX" and divides it to Cn "cn=Valek" and Base "ou=OOOO,o=XXX"

    (I was dividing it using the first coma in the input string.)


  3.  

    function LdapGetAttribute(aUserFqdn: string; aAttrib: string): string;
     var Ldap: TLDAPSend;
         Attribs: tStringList;
         Cn, Base: string;
     begin
     result:='';
     Ldap:=TLDAPSend.Create;
     try
      Ldap.UserName:=Config.LdapUser;
      Ldap.Password:=Config.LdapPassword;
      Ldap.TargetHost:=Config.LdapHost;
      Ldap.TargetPort:=Config.LdapPort;
      Ldap.AutoTLS:=true;
      if Ldap.Login then begin
       if Ldap.Bind then begin
        Attribs:=tStringList.Create;
        try
         Attribs.Add(aAttrib);
         RozdelLdap(aUserFqdn, Cn, Base); // cn=Valek,ou=OOOO,o=XXX -> cn=Valek  +  ou=OOOO,o=XXX
         Ldap.Search(Base, false, '('+Cn+')', Attribs);
         if (Ldap.SearchResult.Count>0)and(Ldap.SearchResult[0].Attributes.Count>0) then begin
          result:=Ldap.SearchResult[0].Attributes[0].Text;
         end;
        finally
         FreeAndNil(Attribs);
        end;
       end;
      end;
     finally
      FreeAndNil(Ldap);
     end;
    end;

     


  4. Hello, many years ago, I have used something like this for Novell eDir:

     

    function LdapOverPrihlaseni(aUserName, aPassword: string): boolean;
     var Ldap: TLDAPSend;
     begin
     result:=false;
     if aPassword='' then exit;
     Ldap:=TLDAPSend.Create;
     try
      Ldap.UserName:=aUserName;
      Ldap.Password:=aPassword;
      Ldap.TargetHost:=Config.LdapHost; // 'novell.xxxxx.cz';
      Ldap.TargetPort:=Config.LdapPort; // '389';
      Ldap.AutoTLS:=true;
      if Ldap.Login then begin
       if Ldap.Bind then begin
        result:=true;
       end;
      end;
     finally
      FreeAndNil(Ldap);
     end;
    end;

     

    ldapsend.pas was part of Synapse.


  5. 11 minutes ago, sjordi said:

    Actually, I don't find it. It's not known from the compiler, and I have no trace whatsover of any file that looks like it besides a DCU file... but not seen
    I'm under Alexandria...

    Docwiki at Embarcadero doesn't reference it either... nor does the help...

    I think I'm missing something.

     

    In Delphi 11, it is in C:\Program Files (x86)\Embarcadero\Studio\22.0\source\rtl\common\System.StartUpCopy.pas in my installation.

    Help and doc - ehm... Did not find them.

    • Like 1

  6. 3 minutes ago, Stano said:

    No, no and no. Don't read the instructions!
    I don't know if you want to know: If you do not divide by not an integer, then you have to retype. E.g.
    CAST (1/3 AS DOUBLEPRECISSION) AS RESULT 

    Otherwise, the result will be Integer.

    This will evaluate to zero:

    SELECT CAST (1/3 AS DOUBLE PRECISION) AS RESULT FROM rdb$database

     

    This will ealuate to 0.333333333333333333:

    SELECT CAST (1 AS DOUBLE PRECISION) / 3 AS RESULT FROM rdb$database

     

    But original question is about something else (probably windowing functions).


  7. So there must be something different in your real SQL 🙂

     

    What about:

    select
     cast(cast(10 as double precision) / 0.3048 * 14.7776 as NUMERIC (18,2))
     from rdb$database a


  8. select
     cast((10.00000 / 0.3048) * 14.7776 as NUMERIC (18,2))
     from rdb$database a

     

    It works for me.

    Without the cast, there is 13 decimal places, so only 5 places is left in front of the decimal point.

     


  9. 10 minutes ago, FreeDelphiPascal said:

    We cannot send our 1 million lines of code to Emba.
    Maybe Emba should save some kind of crash like (ever heard of MadShi) to disk. They will get more info from there.

    Maybe Emba could use remote debugging - I believe anybody with such a problem would allow Emba to do remote debugging on his/her computer.

×