Pointer and/xor set failure lazarus / 61-Beginners ---------------------------------------------------------------------- d2010 · 2025-02-05 22:58 I need replace the lines asm..end with PurePascal; because the VirtualPascal not accept value of "Cardinal" RangeChecking Error. Many times the value of AttrCol is $FFFFFFF . How to set AttrCol:=AttrCol and $3FFFFFFF? Function vla_file_compressed2(Const Name:string):shortstring; Code: [Select]Var AttrCol: pchar;     cow:__pin32;     dwg:integer;     rtcan:boolean; begin cow.int:=0;       cow.asc[0]:='2';       attrcol:=nil;       result:='';       rtcan:=false;       if (Name='') then Begin cow.asc:='0nil';exit;end;   Try   AttrCol := Pointer(GetFileAttributes(PChar(Name)));        rtcan:=pointer(AttrCol)=pointer(kINVALID_FILE_ATTRIBUTES);       asm mov eax,AttrCol           and eax,$3FFFFFFF           mov AttrCol,Eax           mov cow.int,Eax       End;   Except       cow.asc[0]:=#10;       result:=inttohex(cow.int,8);       exit;   End;   if rtcan then  Begin result:='1ifa';exit;end;   if (cow.asc[0]=' ')and (rtcan=false) then    Begin  if (Cow.int and faDirectory  <> 0) then result:='d' else result:='f';           if (Cow.int and faTemporary <> 0)  then result:=concat(result,'temp+');           if (Cow.int and faOffline <> 0) then result:=concat(result,'offline+') else           if (Cow.int and faDevice <> 0) then result:=concat(result,'device+') else           if (Cow.int and faVirtual <> 0) then result:=concat(result,'virtual+') else           if (Cow.int and faSparseFile <> 0) then begin result:=concat(result,'sparsefile+');            end else           if (Cow.int and faReparsePoint <> 0) then result:=concat(result,'sparsepoint+') else           if (Cow.int and faCompressed <> 0) then result:=concat(result,'compressed+') else           if (Cow.int and faNormal <> 0) then result:=concat('norm+',result);           if ((Cow.int and faHidden) = faHidden) then result:=concat('hidden+',result);           if ((Cow.int and faReadOnly) = faReadOnly) then result:=concat('readonly+',result);    End; end; ---------------------------------------------------------------------- BrunoK · 2025-02-06 11:41 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function vla_file_compressed2(const Name: string): shortstring;var  AttrCol: pchar;  cow: __pin32;  dwg: integer;  rtcan: boolean;  lEax: DWord;begin  cow.int := 0;  cow.asc[0] := '2';  attrcol := nil;  Result := '';  rtcan := False;  if (Name = '') then begin    cow.asc := '0nil';    exit;  end;  try    AttrCol := Pointer(GetFileAttributes(PChar(Name)));    rtcan := pointer(AttrCol) = pointer(kINVALID_FILE_ATTRIBUTES);    // asm    lEax := AttrCol and $3FFFFFFF; // MOV     EAX,AttrCol                                   // AND     EAX,$3FFFFFFF    AttrCol := lEax;               // MOV     AttrCol,EAX    cow.int := lEax;               // MOV     cow.int,EAX  // end;  except    cow.asc[0] := #10;    Result := inttohex(cow.int, 8);    exit;  end;  etc ... As a side note : - Could you please include pascal code between tags using # button you find above the message text box. - If possible, submit code with reasonable formatting. This you can do by adding (if not already done) the package jcfidelazarus to your lazarus and Ctrl+D (or Menu/Source/JEDI code format).