×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Is there equivalent for VFP's REPLICATE() in .NET?

Is there equivalent for VFP's REPLICATE() in .NET?

Is there equivalent for VFP's REPLICATE() in .NET?

(OP)
Colleagues,
I've been working in VFP for so-o-o long! T'was wonderful RDBMS (that now all but RIP).
But - "tempora mutantur et nos mutamur in illis", and I went back to VB, this time - in .NET.
There were many built-in functions in VFP that I used quite often, one of them was REPLICATE(), e.g.

CODE

REPLICATE("*", 16) 

gives you

"****************"

Is there any equivalent in .NET to that VFP's function? Or I'll have to "roll yer own"?

TIA!

Regards,

Ilya

RE: Is there equivalent for VFP's REPLICATE() in .NET?

Did you try this? smile

You will find out:
Dim a As New String("*"c, 16)


---- Andy

There is a great need for a sarcasm font.

RE: Is there equivalent for VFP's REPLICATE() in .NET?

(OP)
It requires two lines of code, e.g.

CODE

Dim a As New String("*"c, 16)
'...
File.WriteAllText(cFullPath, a) 

I was hoping to have one line only. Can't test it now, so have to ask: Would

CODE

File.WriteAllText(cFullPath, String("*",16) 

do the same?

Regards,

Ilya

RE: Is there equivalent for VFP's REPLICATE() in .NET?

File.WriteAllText(cFullPath, New String("*",16))

RE: Is there equivalent for VFP's REPLICATE() in .NET?

(OP)
Ah! Gotta be

CODE

New String() 
Right! My overlook ("mea culpa!" blush)
Thank you, colleague!

Regards,

Ilya

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close