Test a string Variable in a Script of the Application

Hey all, I am working with a script that takes the calling party number when the town crier. This string is converted to an integer and this number is used to fill our desktop application help when the call is connected to an agent. It works very well unless the calling party number is unknown. When this produces the application stops when it tries to convert the string value to an integer. Anyone know how I can test the string value to determine if it's a number before converting entire? This is how my script works.

1. get call details. (sets the number of the call as string CallingParty)

2 set CallingPartyINT = CallingParty (this is the breaking point)

3 test CallingPartyINT and determine the location for the routing of the CSQ.

Thanks in advance, if you have ideas on how I should do this.

After the first step where you get the number of the caller in the CallingParty string. I would use an 'IF' check to see if there is something in the chain of CallingParty.

Use the 'IF' step, and then click... to launch the expression editor. Then type:

CallingParty == «»

If there is anything she will assess as 'true' and you can take steps to prevent it to be converted to an integer. If it is false, you can handle the call and convert the value to an integer.

Tags: Cisco Support

Similar Questions

  • variable access from anywhere in the application

    Guys I have a main application file, then a bunch of components that, basically, I built. In each of the components of this I forth. Anywyas I really need to set some global variables that may acess through the entire application, not which means that all components and similar applications. What is the best way to do this. I tried the singleton class but it dosent seem to happen there? I have it does not resemble the custom event is working for me im im sure something wrong. All of the suggestions.

    Miguel

    Use a static variable of a class. that can appear in the world to the entire application

    as

    public class Someclass{
    
         public static var string:String = 'Something";
    
    }
    

    about access you can do

    Someclass.string += 'another string';
    
  • Download a file using a php script when running applications with LCD screens

    Hello! I'm developing an application in Flex 2 / Java - running on the LCD / JRun server.

    I'm trying to add downloading features. I use a script php to the download section.

    First, I'm just trying to put the script in the application directory. Does not work.
    After that I created an apache server where I put a small web site with my script. He tells me that my file is downloaded correctly, but I can't find the file. The apache log I don't give no errors.

    Can someone help me?

    Originally, I had problems w / the file placed in C:/whatever.ext b/c I was not using relative paths.

    This is the code I use:
    --------------------------------

    $MAXIMUM_FILESIZE = 1024 * 1024 * 2; 2 MB
    $newFileLoc = '. '. "/ wherever/file.jpg.

    If ($_FILES ['Filedata'] ['size'])<= $maximum_filesize)="">

    move_uploaded_file ($_FILES ['Filedata'] ['tmp_name'], ".") / temporary / ". $_FILES ['Filedata'] ['name']);"

    Rename ("./temporary/". $_FILES ['Filedata'] ['name'], $newFileLoc);
    chmod ($newFileLoc, 0777);

    }

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

    Editing of this article by Adobe:

    http://livedocs.Adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=live Docs_Book_Parts & file = 17_Networking_and_communications_173_6.html

  • Using the string Variable name to ChnFind

    Overview - I find crossing points of zero on a set of data so that I can calculate the phase shift of channel to another in my data.

    Small image - I start by finding the zero 1 cross in the data, once I found I want to use the index to find the next and so on

    Problem

    The posted script comes from looking for the 1st pass by zero before moving on to the next channel. The problem is that I can't find out do my group and channel changes with loops.

    Option Explicit  ' force explicit declaration of all variables in a script.
    Dim intCount, intChan ' loop variables
    Dim z

    IntCount = 2 GroupCount-1 ' groups
    Call GROUPDEFAULTSET (intCount) ' change the current group
    IntChan = 1 to ChnNoMax ' Browse channels
    Z = ChnFind ("Ch(""[intCount]/[intchan]"")<0") 'this="" does="" not="" work,="" but="" i'm="" not="" sure="" how="" to="" fix="">
    MsgBox (z)
    next

    I don't know I'm missing something obvious.

    MK

    Hi Michael,

    You need not global variables to simplify this, but I would certainly use object variables to simplify.  When indexing of groups or channels, it is easier to use the variable of index with the Data.Root.ChannelGroups collect or Group.Channels collection directly.  I also prefer to store the group object and the channel object in a variable.  For example, you can then use Channel.DataType to add exactly the same string data to the new group coming from the old group.  You can also easily get the name, unit and all sorts of other properties directly from the object variable.  I prefer to use a separate group object variable to reduce congestion in the colde, although it adds 2 lines to your example of code snippet.

    Set FromGroup = Data.Root.ChannelGroups (intCount)
    Set FromChannel = FromGroup.Channels (intChan)
    Define participatory = Data.Root.ChannelGroups ("Index" & FromGroup.Name)
    The rise in the value = ToGroup.Channels.Add (FromChannel.Name & "Rising", DataTypeChnFloat64)
    Fall in the value = ToGroup.Channels.Add (FromChannel.Name & "Falling", DataTypeChnFloat64)

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • [JS, Win/Mac] The Clipboard string variable?

    Hello

    I want to put the contents of a string variable to the system Clipboard. For Mac, it is simple via AppleScript, but how this might work for windows? I searched and read all relevant messages and did some research with google.

    Here is my potion of the code:

    // copy to clipboard
    if ( $.os.toLowerCase().indexOf('mac') >= 0 ) {  
        app.doScript ( 'set the clipboard to item 1 of arguments', ScriptLanguage.applescriptLanguage, [_stringOUT] );  // mac
    } else {
        app.doScript ( 'echo ' + _stringOUT + ' | clip', ScriptLanguage.visualBasic );  // win
    }
    

    One of my friends has tested the Windows part - I work only on a Mac-, but it does not work. Is someone can you please help me understand this?

    Thank you!

    Tobias

    After a long search, I think I finally did:

    _OUT = "Ich bin ein Copy-Paste-Test.";
    if ( $.os.toLowerCase().indexOf('mac') >= 0 ) {  // widows to clipboard
        app.doScript ( 'set the clipboard to item 1 of arguments', ScriptLanguage.applescriptLanguage, [_OUT] );  // mac
    } else {
        app.doScript ( 'Dim theObject\r Set theObject = CreateObject (\"htmlfile\")\r Call theObject.ParentWindow.ClipboardData.SetData(\"text\",\"'+_OUT+'\")', ScriptLanguage.visualBasic );  // win
    }
    

    Can someone please test this piece of code on a windows machine?

    Thank you!

    Tobias

  • Pass a URLRequest defined string variable

    Hi people,

    So I tried to write a script that loads a file, what variables are then extracted from. I've seen a lot of questions related, and some are probably the same. I'm new on this so I do not really understand the solutions that have been given. I worked on this problem for some time now and there is very little progress. Help would be greatly appreciated. Thank you in advance.

    With all that being said, here is my annotated code, the name of executives and a commentary corresponding to the main line of the code that is troubled are bold and underlined.

    #########################################################################################

    WelcomeBack; It is the first image.

    Whose purpose is simply to display "Welcome Back" with a start button.

    Once you press the button start, "Please enter your item number" is displayed.

    The user then types in the number that will be used to load their data (already registered).

    This image seems to work very well.

    import flash.events.TimerEvent;

    import flash.utils.Timer;

    Stop();

    questions of the var: Array = ["Please enter your item number."];

    var q: int = 0;

    var gameTimer:Timer = new Timer (240000,1);

    var endTimer:Timer = new Timer (2000,1);

    var subjectStr:String = new String;

    var fileStr:String = new String;

    var file:Array = new Array;

    txtAnswer.restrict = "0-9";

    txtAnswer.visible = false;

    txtQuestion.autoSize = TextFieldAutoSize.CENTER;

    btnStartDistractor.addEventListener (MouseEvent.CLICK, nextProblem);

    gameTimer.addEventListener (TimerEvent.TIMER_COMPLETE, endGame);

    var ext:Array = ["_Overall.txt"];

    var object: Array = new Array;

    var yokedSchedule:Array = new Array;

    function processInput (evt:KeyboardEvent): void

    {If (evt.keyCode == Keyboard.ENTER & & txtAnswer.text! = "")}

    { q++

    subjectStr txtAnswer.text = var

    var nested_array:Array = new Array ([subjectStr], [ext]);

    var fileStr:String = nested_array.join("");  If the user puts the number 746, this should set "746_Overall.txt" to the variable "fileStr.

    var file:Array = fileStr.split () / / this probably isn't necessary

    {gotoAndStop ("cache")}

    }

    }

    function nextProblem(evt:Event):void

    {If (q, questions.length)}

    {

    txtAnswer.text ="";

    txtQuestion.text = issues [q];

    stage.addEventListener (KeyboardEvent.KEY_DOWN, processInput);

    If (q == 0)

    {

    txtAnswer.visible = true;

    btnStartDistractor.removeEventListener (MouseEvent.CLICK, nextProblem);

    btnStartDistractor.visible = false;

    gameTimer.start ();

    }

    }

    ElseIf (q == questions.length)

    {txtQuestion.text ="";}

    txtAnswer.text ="";

    gameTimer.removeEventListener (TimerEvent.TIMER_COMPLETE, endGame);

    stage.removeEventListener (KeyboardEvent.KEY_DOWN, processInput);

    {gotoAndStop ("cache")}

    }

    }

    trace (txtAnswer.Text)

    function endGame(evt:TimerEvent):void {}

    endTimer.addEventListener (TimerEvent.TIMER_COMPLETE, endGame)

    endTimer.start)

    txtQuestion.text = 'of TIME UP!";

    txtAnswer.text ="";

    }

    #########################################################################################

    ReadData; It is the second picture.

    The purpose of this framework is to load the file (for example 746_Overall.txt), using the variable called fileStr

    From now on, he can charge a variable defined string (e.g. url), however, it doesn't seem to work when the url is replaced by fileStr

    import flash.net.URLRequest;

    import flash.net.URLLoader;

    to import flash.net.URLVariables;

    import flash.net.URLRequestMethod;

    import flash.events.Event;

    Stop();

    the path to the file backend

    var url: String = "746_Overall.txt"; This variable works;

    trace (fileStr)

    var urlVariables: URLVariables = new URLVariables ();

    trace (urlVariables)

    var request: URLRequest = new URLRequest (url); It works, however, when replaced by fileStr it does not work.

    Request.Method = URLRequestMethod.GET;

    var loader: URLLoader = new URLLoader ();

    loader.addEventListener (Event.COMPLETE, handleLoaderComplete)

    Loader.Load (request);

    loader.addEventListener (Event.COMPLETE, onLoaded);

    function onLoaded(e:Event):void

    {

    yokedSchedule = e.target.data.split(","); split patterns using the comma as separator, otherwise the entire calendar would be an element

    scheduleTextBox.text = String (yokedSchedule);

    trace (yokedSchedule)

    }

    The next line...

    var fileStr:String = nested_array.join("");  If the user puts the number 746, this should set "746_Overall.txt" to the variable "fileStr.

    declares a new variable that brought in the service that you put it in.  If the intention is to assign to the variable you have assigned outside the service, then you shouldn't be reporting again.

    fileStr = nested_array.join("");

    When creating new instances of class objects, you must include the parentheses.

    var fileStr:String = new String();

    var file:Array = new Array();

    If you want to take shortcuts just ignore to create instances and only declare variables until you are ready to assign them.

    var fileStr:String;

    var file:Array;

  • Getting the value of a variable in another script object

    Hi all

    I have a scenario where I have a script object (MyTexts1) that contains a large amount of text in the form (all texts are stored in variables (fx. MyTexts1.infoText1). the variables are named after fields (which means I have a field called "infoText1").

    So for each field, I call a function that takes the name of the field. This function (located in my script called 'functions' object) must somehow, and then find the value of the variable 'MyTexts.infoText1 '.

    Now my question is:

    How can I get the above - scenario and if not why?

    Thanks in advance

    See you soon

    Kim Christensen

    Dafolo c/o

    Denmark

    Hello

    You can do with the object as a script.

    For example the "MyTexts" script with string variables object and a function to return values.

    var infotext1 = "Lorem ipsum dolor sit amet"
    var infotext2 = "Non eram nescius Brute cum"
    
    function getText(FieldNumber) {
              return eval("infotext" + FieldNumber);
    }
    

    To populate a field, you can call the function in the script object with an argument, which is the alias for the number of variable you want to return.

    You don't need to enter the full somExpression for your script object, the name is sufficient.

    Textfeld1.rawValue = MyTexts.getText(1);
    
  • Multiline string variable

    Hello everyone

    I need to place a multiline text in a .txt file.

    Have a service .php file that creates a file of parameters of the application sent to it:

    <? PHP

    $getVar = $_POST ["TheString"];

    $file = "test.txt";

    $writeVar = fopen ($file, 'w');

    fwrite ($writeVar, $GetVar);

    fclose ($writeVar);

    ? >

    and all the functions of service to send parameters.

    private void sendData(str:String):void {}
    variables = new URLVariables();
    fData = new URLRequest("fileservices/SaveService.php");
    fData.method = URLRequestMethod.POST;
    variable = fData.data;
    fLoader = new URLLoader();
    fLoader.dataFormat = pouvez;
    fLoader.addEventListener (Event.COMPLETE, sendComplete);
    variables. TheString = str;
    fLoader.load (fData);
    }

    Everything works, but can't write a single line of string to a file.

    When to send a paragraph containing "/ n" string character, it doesn't in the .txt file opened with Notepad.

    So what is this specific character to use to mark the return of paragraphs,

    or should I use the different class instead of the string.

    or I change my .php file to add this ease of use (and what is that magic changes to bring)?

    Thanks in advance

    almost all applications displays two lines when your use \r EXCEPT Notepad.  for notepade, use

    "\r\n".

    to a new line

  • Is any String variable or something that have entry and exit data?

    Is any String variable or something that have entry and exit data?

    I give it up! Everything is too complicated for me I want you to focus on the typical programming language.

  • Reading local txt file = &gt; string variable?

    Could someone please point me to an example of WebWorks showing how to load the contents of a local (= in the app folder) text file into a string variable? Thank you.

    I assume that by "in the app folder" you mean in the folder bar. If so, he must be a XHR request. I pulled the following from my application.

            var res;
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
                if (xhr.readyState == 4 && xhr.status == 200) {
                    res = xhr.responseText;
                }
            };
            xhr.open("GET",path,0);
            xhr.send();
            // res now contains the contents.
    
  • Creating and reading a variable of several scripts

    I'm creating a series of scripts to our helpdesk and one of the things we're trying to do is play critical for users when troubleshooting connects to the system before being queued. However, we want to be able for that turn on or off depending on whether there are no failures.

    I record outages in help desk in a script, and I give them also the ability to switch a variable in this script as to if the failure Prompt critical should play or not.

    The question I have is how to read the value of this variable in my main script? What is the best way to achieve this?

    Why not write the value of the variable (power) in an XML file?

    See the attached file.

    Please rate of messages.

    adignan-

  • How can I get the contents of an object of Document (XMLDOM) in a string variable?

    Hello

    I created an XML document by using the Document and XMLElement classes and now I need to get the XML object and a string variable, so I can send by e-mail.

    I'm on 4.5 JDE

    Help!

    Hello

    Unlike some other posts, there is a solution.

    Document myDocument = pdocXMLDocument;  / * This is the document that you created that you want to convert to a string

    ByteArrayOutputStream OS = new ByteArrayOutputStream(); / * where you want the XML to go * /;
    XMLWriter writer = new XMLWriter (os);

    configure as you want using one or more of:
    writer.setPrettyPrint (); or setPrintCompressedOutput();
    writer.setPrintCompressedOutput ();
    writer.setPreserveSpacing ();
    writer.setExpandingEntities (boolean);
    writer.setEntityResolver (EntityResolver);
    try {}
    DOMInternalRepresentation.parse (pdocXMLDocument, writer);
    String myXML = os.toString ();        THIS IS THE STRING
    }
    catch (Exception ex) {}
    }

  • Use of Variables in a Script of Essbase report

    I know you can use a variable in a script with Essbase report & at the beginning of the name.  Example & CurMonth.  This works very well for me.  But, you can use & FcstMonths when the value of the months are more than one Member?  It works in a calc script when & FcstMonths = March, April, may, June... etc, but, when I use it in a report script, the script will not validate the saying "unknown member of the value.  I tried to change it to January.February.March... etc.  I also tried February: December.  None of them does not seem to work.  Is it just not possible for Essbase report?  Thanks in advance.

    If you want to include a list of members in the report script, you specify the members separated by spaces.  If you set the variable...

    "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"
    

    ... I think you'll find that it works.

  • Using global variables in all scripts

    Hello

    I have a SOAP client which runs the runScript method.

    SOAP requests to three, one after the other, call runScript and run a jsx on the server.

    Can I have some session-level variables / global whereby I can access via scripts?

    For example, during the execution of the first script, I put a variable. And even once during the second and third queries SOAP, I use the variable (defined in the 1st script) in the 2nd and 3rd scripts.

    How can I get the above?

    I would really appreciate some help on this.

    You can use the #targetengine or insertLabel methods.

    Incapacitated, I would say, of #targetengine, "session01" is the specific session will be exist until InDesign is running, which is not desirable. Those who will destroy only when you exit your application. I don't think that there is no collection for rescue here.

    However, insertLabel and extractLabel can be used on specific DOM objects, according to your need, including the app object.

    If you want to share variables between scripts on a document so that you can store variables on the document object:

    doc.insertLabel ("name", "value");

    So, once the document is closed all the labels are gone. You can choose according to your requirement, you want application-level globals (then use app.insertLabel), level of the document (then doc.insertLabel), spread of level, etc.

  • How to use a value of a string variable as a sound (like an audio file link name) class?

    Hello

    I need to use the value of a string variable as a binding name of any sound in the library, I have this code:

    var SoundArray:Array = new Array;
    SoundArray [0] = "S1";
    SoundArray [1] = 'S2 ';
    SoundArray [2] = "S3".
    var MySound = new SoundArray [0];
    B1.addEventListener (MouseEvent.Click, PlaySound);
    function PlaySound(event:MouseEvent) {}
    MySound.play (0,0);
    }

    where S1, S2, S3 is the name of the class in the name of link for 3 audio files in the library.

    I get this error for the line of code:

    TypeError: Error #1007: instantiation attempted on a non-constructeur.
    at Untitled_fla::MainTimeline/frame1()

    Sorry, sorry, sorry
    the error was not from your code, I had fixed and it is the right code:

    var soundClass = flash.utils.getDefinitionByName (this.) V_Source) as class;
    var currentlyPlayingSound = new soundClass();
    var currentSoundChannel = new Object;
    MovieClip (parent) [this. V_Button] .addEventListener (MouseEvent.Click, PlaySound);
    function PlaySound(event:MouseEvent) {}
    currentSoundChannel = currentlyPlayingSound.play ();
    }

    Thank you very much

Maybe you are looking for