Problems writing a Script ! Pls HELP !

Alejandro Tejada capellan2000 at yahoo.com
Thu Jun 17 19:39:48 EDT 2004


on Wed, 16 Jun 2004 
Riddbaba at gmx.de wrote:

> Hi,
> I have a Problem ... for school i have to write a
> little program wich
> translates a normal text into a text written with
> the morse codes ! 

Interesting assignment! I'm a teacher too.

Is this part of a high school computer programming
course using MetaCard or a general course on
computers?

I'll to read the webpages of your teacher about this
course! Could you post a web address?

> I have started but i am stuck at the point that 
> metacard only translates one single
> letter .... it's really frustrating i have beening
> trying out everything for
> about 5 days now.... ! (i am using MetaCard for 4
> weeks now!) 

I think that you must download the MetaTalk
Programming course:

http://www.metacard.com/pi6.html

> I think i have
> to make some sort of repeat loop so that metacard
> checks every word and then

Here is the error, you must be checking every
character, not every word...

> puts the morse cord in for each word and doesn'T
> just put in the code for
> the last letter...PLEASE help me !! I am loosing
> hope that its even possible
> ....here's my Script sofar ... (only got the letters
> a;b;c cause no üonit of
> doing every letter if the first three ain'T working
> !
> 
> on mouseUp
>   put empty into field "morsetext"
>   put empty into field "standardtext"
>   ask "What would you like to translate?? Was hätten
> Sie gern übersetzt ??"

change to: answer file "What text file would you like
to translate?  

>   if it is not empty then
>     set the cursor to watch
>     put it into field "standardtext"
>     put "it" into field "morsetext"

delete this line: put "it" into field "morsetext"

>     put it into filecontent
>     repeat for each word w in filecontent

Change to:  repeat for each char w in filecontent

>       if "a" is in field "standardtext"  then

change to:  if w = "a" then put ".- /" after field
"morsetext"

Notice, this is only one line, not three lines.
Repeat this line for every letter or character that 
you want to translate to morse.

>       put ".- /" into field "morsetext"
>       end if
>       if "b" is in field "standardtext" then
>         put "-... /" into field "morsetext"
>       end if
>       if "c" is in field "standardtext" then
>         put "-.-. /" into field "morsetext"
>       end if
>     end repeat
>     answer "There you go! Bitte Schön!"
>   end if
> end mouseUp
> 
> Thank You alot ...greets theo !!

You are welcome!

al

=====
Visit my site:
http://www.geocities.com/capellan2000/
Search the mail list:
http://mindlube.com/cgi-bin/search-use-rev.cgi


		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail


More information about the metacard mailing list