SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Sep 2007
    Location
    Australia
    Posts
    367
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    call function name derived from variable

    the code below derives the name of the component to be processed via uft but also is one defined in BPT

    CurrentComponentFound contains the component "enterYourDetails" and the function name is the same

    How can I call the function that is named by the variable?

    CurrentComponentFound = GetTheNextComponentToProcess(WhattoSearchfor,Compo nentIndex,ComponentValue)

    Select Case CurrentComponentFound
    Case "enterYourDetails"
    Call enterYourDetails (WhattoSearchfor, ComponentIndex)

  2. #2
    SQA Knight
    Join Date
    May 2006
    Location
    Playa Del Rey, California, United States
    Posts
    2,647
    Post Thanks / Like
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0
    Most common way in VBScript is the Execute Statement, https://msdn.microsoft.com/en-us/lib...(v=vs.84).aspx

    You basically do string manipulation, then execute that strong as a line of VBScript code.

    One of the many things you'll want to consider is security. Execute statements are prone to code injection. You don't want outside contractors of temporary workers to be able to write statements that gets interpreted by the Execute statement. It's an easy way for them to inject code that is malicious.
    David Lai
    SDET / Consultant
    LinkedIn profile

  3. #3
    SQA Knight bklabel1's Avatar
    Join Date
    Sep 2012
    Location
    Kew Gardens, United States
    Posts
    2,712
    Post Thanks / Like
    Blog Entries
    1
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    David,
    I don't want to do a thread hijack here. I use the Execute statement on occasion but I cannot think of how someone would use it in a malicious way.
    Oh I thought a second longer and seem to understand it better. The execute statement could be working on data. The data can contain a command to do something dangerous.
    Thanks,
    Kevin
    When in Florida, Don't Tampa with the code. I made this up.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:41 PM.

Copyright BetaSoft Inc.