[JScript-Dev] Re: Developing Script [#Filter Mails not addressed to local Domains (bcc)#]

  • From: "Dang Hoai Phuc" <webmaster@xxxxxxxxxxxxxxxx>
  • To: <jscript-dev@xxxxxxxxxxxxx>
  • Date: Mon, 11 Dec 2006 16:47:27 +0700

Hi Sugiyo,
I don't want to make other new participants get confused with some scripting 
concepts, though most of you participated in the course conducted by Victor but 
some others do not. However, I will try my best to satisfy your expectation. 
Your script can be compiled and work but take alook at your use of the Return 
statement in the SpeakTheName function and also the FormatString function 
parameters. Get me back if you success or still troubel, ok?
Phuc
  ----- Original Message ----- 
  From: Sugiyo 
  To: jscript-dev@xxxxxxxxxxxxx 
  Cc: Blind asean 
  Sent: Thursday, December 07, 2006 1:19 PM
  Subject: [JScript-Dev] Developing Script [#Filter Mails not addressed to 
local Domains (bcc)#]


  Dear Vuk, Victor and all

  I am trying to develop the function with parameter. With the function and 
script belo I hope computer wil says:

  1. "You did not enter your first name", if I did not enter the first name.
  2. "You did not enter your last name", if I did not enter the last name.
  3. "You did not enter your whole name, are you a person from other planet?", 
if I did not enter  both first name and last name. 
  4. "Hello world, my name is %1 %2.", If I enter both first name and last 
name. 



  The script can be compiled unfortunately the result doesn't work properly. 
Can any one edit the script below?



  Script for message file



  ;Messages file for notepad

  ;Created by Sugiyo

  ;This script created for excercise in creating script

  Messages

  @MsgName

  Hello world, my name is %1 %2.

  @@

  ; message for missing or no name

  @MsgNoFirstName

  You did not enter your first name.

  @@

  @MSGNoLastName

  You Did not enter your last name

  @@

  @MSGWholeName

  You did not enter your whole name, are you a person from other planet? %3 %3.

  @@

  EndMessages



  Function:



  Void Function SpeakTheName (string sFirstName, 



  string sLastName, string sWholeName)

  Var

  String sMessage

  If sFirstName == "" Then; check to make sure text was actually passed in the 
sName parameter

  SayFormattedMessage (OT_ERROR, MSGNoFirstName)

  Return; exit the function

  EndIf

  If sLastName == "" Then

  SayFormattedMessage (OT_ERROR, MsgNoLastName); speak an error message

  Return

  EndIf

  If sFirstName == "" && sLastName == "" Then

  SayFormattedMessage (OT_ERROR, MsgWholeName); speak an error message

  Return

  EndIf

  Let sMessage = FormatString (MsgName, sFirstName, sLastName, MSGWholeName) ; 
format the message using the passed parameters

  SayFormattedMessage (OT_MESSAGE, sMessage)



  EndFunction



  Script



  Script SayName ()



  Var

  String sLastName,

  String sName,

  String sWholeName,

  String sPrompt,

  String sTitle

  Let sTitle = "Name Entry"

  Let sPrompt = "Enter your first name:"

  InputBox (sPrompt, sTitle, sName)

  Let sPrompt = "Enter your last name:"

  InputBox (sPrompt, sTitle, sLastName)

  SpeakTheName (sName, sLastName, sWholeName)



  EndScript



  Best Regard

  Sugiyo



------------------------------------------------------------------------------


  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.5.432 / Virus Database: 268.15.15/580 - Release Date: 12/8/2006 
12:53 PM

Other related posts:

  • » [JScript-Dev] Re: Developing Script [#Filter Mails not addressed to local Domains (bcc)#]