Link to home
Start Free TrialLog in
Avatar of Iwanttoownz
Iwanttoownz

asked on

Replacement for FillChar function

Hey,

I need a replacement of the function FillChar in delphi or I need the original function that is in delphi.
Both are preferred..
Thanks in advance.
Avatar of 2266180
2266180
Flag of United States of America image

from delphi help:

FillChar procedure

Fills contiguous bytes with a specified value.

Unit

System

Category

character manipulation routines

Delphi syntax:

procedure FillChar(var X; Count: Integer; Value: Byte);

Description

In Delphi, FillChar fills Count contiguous bytes (referenced by X) with the value specified by Value (Value can be type Byte or Char).

Warning:      This function does not perform any range checking.

is this not what you are looking for?
Avatar of Iwanttoownz
Iwanttoownz

ASKER

Nope.. I need the code:

procedure FillChar(var X; Count: Integer; Value: Byte);
begin
...
..
..
..
....
end;
that code is part of delphi which is under copyright, so we cannot post it. it would be illegal.
if you do not have the version that comes with sources (professional and above) you cannot see that code.
if you do have it, jsut open system.pas and it's there.  In my delphi 7 it's on line 5057.

what do you need it for? wouldn't some other fillchar procedure be good?
ASKER CERTIFIED SOLUTION
Avatar of ThievingSix
ThievingSix
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ciuly I currently use Enterprise, has Profession given any benifits that are worth while?
enterprise is a 'better' version than Professional.

This means you have all VCL source code. Check for c:\program files\borland\?\source\Win32\rtl\sys\system.pas

The ? depends on the version of  Delphi you are using.
In that file, you can find the sources of FillChar
>> @ciuly I currently use Enterprise, has Profession given any benifits that are worth while?

dunno. I'm on enterprise as well. I just recall (maybe incorrectly) that professional also has the VCL sources. for some reason I've been living with this information for quite a while :)
Can anyone recode it?
*Points at my first post*

There it is?
As far as I know the real fillchar() uses rep stowsb, but mine works just the same.

Also fillchar for me in enterprise points to this in system.pas:
unit System; { Predefined constants, types, procedures, }
             { and functions (such as True, Integer, or }
             { Writeln) do not have actual declarations.}
             { Instead they are built into the compiler }
             { and are treated as if they were declared }
             { at the beginning of the System unit.     }


Thanks ThievingSix

But I need it recoded, same function different code.
That is recoded? What exactly do you need?
>> Also fillchar for me in enterprise points to this in system.pas:

search for it. you will find a _fillchar proc there ;) (note the leading underscore)
!! Your right lmfao..I knew it they used STOSB!!

Thanks XD
Do you need something like StringOfChar??? but that finally calls FillChars?
http://www.montefiore.ulg.ac.be/~latour/doc/pascal_fpc/html/ref/refsu178.html
But it is more friendly.

I do not get the idea of what you really needs.
I need same function, but with different code.
That IS different code. The code in system.pas isn't that. I recreated it.
I don't understand why I got a B grade. If I haven't fullfiled your answer you should give the expert a chance to earn that 'A' grade.