×
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

I need help writing a simple program

I need help writing a simple program

I need help writing a simple program

(OP)
I need to write a program to transfer 2 sentences into pig latin. for example: he left today. -- ehay eftlay odaytay.
Please help i can only get so much

(program -- (input, output);

(*------------*)
(*------------*)

uses
   crt;              please help

var


begin   

RE: I need help writing a simple program

Have a look at pages 313 to 315 of "Visual Basic 6 How to Program" by Deitel, Deitel and T.R. Neito (Prentice Hall)

RE: I need help writing a simple program

Not sure if this is what you are looking for
because it is written for SQL SERVER 7.0,
but you might be able to modify it!?!

CREATE PROCEDURE spP_L
(@phrase varchar(1000))
AS
set nocount on
declare @array varchar(1000) /* sentance passed from Call of sp_*/
declare @separator char(1)
declare @separator_position int  /*used to locate each separator charachter*/
declare @array_value varchar(1000) /*holds each array value as it is returned*/
declare @PigTranslator varchar(1000) /*holds return of each returned array to return one(1) sentance)*/

set @separator=' '  /*Setting separator to the 'space' between words*/
set @array = @phrase + @separator
set @PigTranslator='    
while patindex('%' + @separator + '%', @array)<>0
begin
    select @separator_position = patindex('%' + @separator + '%', @array)
    select @array_value = left(@array, @separator_position -1)
        set @PigTranslator =@PigTranslator+' '+substring(@array_Value,2,(len(@array_VAlue)-1))+substring(@array_Value,1,1)+'ay'
        select @array = stuff(@array, 1, @separator_position, ')
end
Select @PigTranslator

set nocount off

/* Original Parsing sp_ created by graz@sqlteam.com
    'Pig Latin' modifications made by mGruodis@aol.com*/
hope this helps,
Michael

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