We help IT Professionals succeed at work.

Replacement for FillChar function

Iwanttoownz
Iwanttoownz asked
on
990 Views
Last Modified: 2013-11-23
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.
Comment
Watch Question

Top Expert 2007

Commented:
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?

Author

Commented:
Nope.. I need the code:

procedure FillChar(var X; Count: Integer; Value: Byte);
begin
...
..
..
..
....
end;
Top Expert 2007

Commented:
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?
Developer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
ThievingSixDeveloper
CERTIFIED EXPERT

Commented:
@ciuly I currently use Enterprise, has Profession given any benifits that are worth while?
MerijnBSr. Software Engineer
CERTIFIED EXPERT

Commented:
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
Top Expert 2007

Commented:
>> @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 :)

Author

Commented:
Can anyone recode it?
ThievingSixDeveloper
CERTIFIED EXPERT

Commented:
*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.     }


Author

Commented:
Thanks ThievingSix

But I need it recoded, same function different code.
ThievingSixDeveloper
CERTIFIED EXPERT

Commented:
That is recoded? What exactly do you need?
Top Expert 2007

Commented:
>> 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)
ThievingSixDeveloper
CERTIFIED EXPERT

Commented:
!! Your right lmfao..I knew it they used STOSB!!

Thanks XD
Martin BarredaPropietario asociado

Commented:
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.

Author

Commented:
I need same function, but with different code.
ThievingSixDeveloper
CERTIFIED EXPERT

Commented:
That IS different code. The code in system.pas isn't that. I recreated it.
ThievingSixDeveloper
CERTIFIED EXPERT

Commented:
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.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.